10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I'm very used to use set -e to break my scripts if any command exits with a non-zero status.
As a policy, I'm willingly expecting echo hello | grep a to break the script.
The commands test 1 -eq $1 && echo hello exits with a non-zero status if $1 is not 1. BUT... It doesn't break... (2 Replies)
Discussion started by: chebarbudo
2 Replies
2. Shell Programming and Scripting
see below for a housekeeping script which constructs an ssh cmd using some server/path/sudo info found in $HRINST.
the script should hop to each server and if it finds a file to cleanup, moves it to the archive dir
if there is nothing to move, it should report so and email the output
... (3 Replies)
Discussion started by: jack.bauer
3 Replies
3. Shell Programming and Scripting
Hello;
I regularly run monitoring scripts over ssh to monitoring scripts
But whenever a server is hung or in maintenance mode, my script hangs..
Are there anyways to trap exit status and be on my way ??
Looked at the ssh manpage and all I can see is a "-q" option for quiet mode ..
Thank... (2 Replies)
Discussion started by: delphys
2 Replies
4. UNIX for Dummies Questions & Answers
I get an error when I grep my results into a variable when the grep finds more than one file.
FND="$(find ediout* -mmin -60)"
if ; then
STR="$(find ediout* -mmin -60 -exec grep -l "ERRORS Encountered" {} +)"
fi
When there is only one ediout file it works fine. How do I... (11 Replies)
Discussion started by: aispg8
11 Replies
5. Shell Programming and Scripting
Hi all,
I am trying to grep a .txt file for a word. When I hit enter, it returns back to $
The file is 4155402 in size and is named in this way:
*_eveningtimes_done_log.txt
I use this command, being in the same directory as the file:
grep -i "invalid" *_eveningtimes_done_log.txt
... (16 Replies)
Discussion started by: DallasT
16 Replies
6. Shell Programming and Scripting
my intension is to use a grep command inside the shell script
and if any row is returned or not..
depending on the resultset i have to code on further.
how to check this
i mean.. could anyone help me out with the if condition how to use it here !! (4 Replies)
Discussion started by: gotam
4 Replies
7. Shell Programming and Scripting
Hi all!
I've faced with very unintelligible error using find/grep like this:
root@v29221:~# find /var/www/igor/data/www/lestnitsa.ru | grep u28507I get nothing as a result, but:
root@v29221:~# grep u28507 /var/www/igor/data/www/lestnitsa.ru/_var.inc
$db_name = 'u28507';... (2 Replies)
Discussion started by: ulrith
2 Replies
8. UNIX for Dummies Questions & Answers
Is there a command where I can pipe my grep into it and it will output it with spaces rather than returns?
Example
I want to turn
prompt$ grep blah file
blah
blah
into this
prompt$ grep blah file | someCommand
blah blah (1 Reply)
Discussion started by: mrwatkin
1 Replies
9. Shell Programming and Scripting
Greetings, using ksh on Solaris, I am trying to identify the current version of a package installed on multiple servers using if statement in a precursor to upgrading.
I have searched the forums and have found many hits, reviewed 3 pages and have tried the different variations noted there. Also... (3 Replies)
Discussion started by: 22blaze
3 Replies
10. Shell Programming and Scripting
hi
I get test: unknown operator status
if
then
echo "OK."
return 0
else
echo "not ok" 2>&1
exit -1
fi
I tried to change "A" with 'A' --> same error
I tried to change
if , I am getting: (3 Replies)
Discussion started by: melanie_pfefer
3 Replies