AboutWelcome to Free Software Daily (FSD). FSD is a hub for news and articles by and for the free and open source community. FSD is a community driven site where members of the community submit and vote for the stories that they think are important and interesting to them. Click the "About" link to read more...
Bash functions, unlike functions in most programming languages do not allow you to return a value to the caller. When a bash function ends its return value is its status: zero for success, non-zero for failure. To return values, you can set a global variable with the result, or use command substitution, or you can pass in the name of a variable to use as the result variable.
This is the third article in the “CLI tricks” series. This time we are going to cover UNIX-specific pipes, streams and redirections, explaining what they are for and how they can help us in every day console tasks.
One of the really useful features almost every Unix shell has is support for command aliases – a way to run a command or a series of Unix commands using a shorter name you get associated with such commands.
The Network Time Protocol (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP port 123 as its transport layer. It is designed particularly to resist the effects of variable latency (Jitter).
Bash has had multi-processing for a long time, via job control, the $! environment variable, and the "wait" command. Judicious use of parentheses for sub-processes, and pipes where necessary, can put comparatively long-term procedures into the background. Bash 4 now provides a new multi-processing paradigm for shell scripting, via the "coproc" statement.