Relative Content

Tag Archive for shell

getting pid of the background job using “$!”

I’ve a written a shell script to launch multiple background jobs and store the process id’s of them in an array using $!. In the end I print all the process id’s by iterating through the array. I want to know is the shell script written has a bug? And, the reason I feel there is a bug in my shell script is because $! might return the process id of another process if in case there are multiple processes being created in my PC.

Check if instance/daemon is running

I want a program to tell me if it is already running, if I try to start at, while it’s active.
Fx. in the terminal, I can get the status of a daemon by doing: sudo /etc/init.d/myDaemon status

User Configuration of a Shell Script. Best practices?

I am writing a shell script with a few variables that should be configured by the user. There will be an installer for downloading and configuring the script, possibly by asking a series of question. The script in question is aimed at other developers.

DB API for shell scripting (any shell)

I am faced with some legacy shell scripts that run batch data processing jobs in Oracle using SQL+. For the most part, the data tier does not have to communicate back to the script with retrieved data to be passed for shell-level processing but in a few cases it does.