UNIX command that says "proceed to the next command"?
Unix gurus,
I have a requirement to check whether a db is running or not and send an email if any or all of them are not running.
I have written the code for checking (in the same order):
1. the database processes
2. the listener process
3. the database login
If the database background processes (i.e., unix processes) are not running, then send email and this is working fine.
If they are running, then continue to the next check i.e., listener process. This is where I'm having problems.
I would like to know if there is any command that I can use in my if construct that says "proceed to the next command"?
Note:
1. I know that I can't use the continue command as I am using a loop and it will go to the next iteration skipping the required checks.
2. I know that I can totally remove the else part of the IF construct but I'm curious to know if there is any command that says "proceed to the next command".
3. send_mail is also a function that uses mailx to send emails.
@Otheus, no I don't have any commands to run in the else part. However, I wanted to know if there is a single command (not echo "" > file) that I can use to proceed to the next command.
Moreover, the IF construct is inside a for loop and hence, I can't use the "break" or "continue" commands too.
@Perderabo, yes seems like you've hit the bulls eye. That is exactly what I wanted.
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
I am going through the Unix Made Easy second edition book by John Muster. So far it's been very informative and I can tell it may be a bit out of date.
In one of the exercises it talks about the "sort" command and using it to sort column's of data etc. The "sort" command has changed a bit and... (1 Reply)
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have high values (such as ˙˙˙˙) in a text file contained in an Unix AIX server. I need to identify all the records
which are having these high values and also get the position/column number in the record structure if possible. Is there
any Unix command by which this can be done to :
1.... (5 Replies)
system() call imeplemented in solaris is such a way that:
Command not found - return code 1
Command executed successfully without Output - return code 1
how to distinguish between these two based on return code in a c - file?
Can you help on this ? (5 Replies)
Hi All,
I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)