Thank you very much for your replies.
What I want to do is: I will run a program and write the result of its execution to the file "result.txt". Then I grep in the output file, if it contains the phrase "VERIFICATION SUCCESSFUL", it means the verification process is successful.
Then I need to run a complicated multi-level if statement whose conditions are the verification result. Something like this:
I can test the exist of the phrase by this way:
But how can I make a wrapper of it, to use the verify function as above?
Last edited by Scott; 12-05-2011 at 04:58 AM..
Reason: Code tags, please...
Hi,
I've a question on awk. In English I want to:
(a) open a file, (b) search through the file for records where length of field15 > 20 characters and (c) print out some fields in the record.
I've written the following and it works OK. The trouble is this will ALWAYS write out the column... (5 Replies)
Hi there
We have boxes named server-sybase2, server-oracle1, etc etc
Does any body know how I can construct an if statement to say, if the hostname of the box contains the string "sybase" then do X ie
if
then
X
fi
any help would be greatly appreciated (6 Replies)
In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands.
How do I write the "do nothing" statement in the following example?
Example:
if (( "$x"="1" && "$y"="a" && "$z"="happy" ))
then
do nothing
else
command
command
fi... (3 Replies)
I am writing a Bash script that will either clone a database or setup a standby database. So Parameter 2 will be the operation type. If the value is not clone or standby I want to throw an error message. I suppose I can also do a case block. So far i have been unable to get the syntax working... (1 Reply)
Hi
I have the following case statement:
case $larg in
*_* )
a=${larg%_*}; b=${larg#*_};
;;
*^* )
a=${larg%^*}; b=${larg#*^};
;;
esac
I cannot figure out what *_* and *^* stand for...
Also what a=${larg%_*}; b=${larg#*_}; and
a=${larg%^*}; b=${larg#*^}; ... (1 Reply)
Hi there
I am trying to write an if statement in perl that will return "SUCCESS" if either of these conditions are true
a) if $changes is greater than 5 AND the $force flag is set to 1
OR
b) if $changes is greater than 0 AND $changes is less than 6
#!/usr/bin/perl -w
my $force =... (5 Replies)
Hi,
I'm trying to write an if statement that will check the USER parm against some text but I'm not quite sure how to use the or switch in the statement.. Can anyone help me out?...
If someone could also let me know when to use ( or if (( $USER != "user1" || "user2" || "user3" || "user4" ))... (6 Replies)
Good Morning,
I typically run a batch of commands, from the command line, to process server operating statistics. That would look like this:
(these are days of the month)
In this instance I am processing a directory of file for July 6th 7th etc.
Those files would have names... (9 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)