BASH Articles

Write a file-in-file-out program in bash and running processes in parallel

In this script, we use a concept called file-in-file-out (FIFO), also known as pipes, to pass along a parameter to several “worker” scripts. These workers operate in parallel (in other words, mostly independent of the master process), read an input, and execute a...

Write a bash script to leveraging timeout when waiting for command completion

Sometimes, waiting for a command to finish execution or ignoring commands until completion might not be considered a solid practice in scripting, though it does have applications: Where commands take variable lengths of time to complete (for example, pinging a network...

Write a bash script for using temporary files and lock files in your program

Another mechanism or component programs and scripts often use is called a lock file. It’s usually temporary (it resides in /tmp) and is sometimes used when multiple entities rely on a single source of data or need to know that other programs exist. Sometimes, it’s...

Write a bash script for generating and trapping signals for cleanup

You have probably pressed Ctrl + C or Ctrl + Z without knowing what was occurring—it’s just like pressing Ctrl + Alt + Delete in another OS, right? Well, in one regard, yes—it is a signal, but the action itself is very different in Linux. A signal at the hardware...

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.