May 212014
 

Original article by Linux Brigade

Ever have to check a list of Linux servers for various things like what version of CentOS they’re running, maybe how long each has been running to get an uptime report? You can and it’s very easy to get going with it with the command gsh

Group Shell (also called gsh) is a remote shell multiplexor. It lets you control many remote shells at once in a single shell. Unlike other commands dispatchers, it is interactive, so shells spawned on the remote hosts are persistent.
It requires only a SSH server on the remote hosts, or some other way to open a remote shell.
Continue reading »

Flattr this!

Sep 182012
 

Today i was writing a bash script that should manage some input arguments, and so i studied getopt, this is a convenient and elegant way to manage input parameters in a bash script. With it you can define switch (present or not) or parameters with an option, thus making your simple bash script much more professional.

Let’s see how to use this command and its options.

Please note that on Linux there are two different ways of parsing command line arguments. There is an utility called getopt (man 1 getopt). This utility is available in all shells. Then in bash, there is another built-in tool for parsing arguments called getopts (it’s a built-in, so it doesn’t have it’s own man-page — try help getopts). In this article I’ll talk of the first one, after some problems with script not working in dash i prefer to use external small programs rather than bash built-in commands.

Continue reading »

Flattr this!