10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
My command is getting stuck while running it.
observed that the grep command doesn't returned any data ($? was 1) and it failed.
This command is assigned into the variable and used in other command as script progresses. To continue the script output, i have to press ^C twice and script... (2 Replies)
Discussion started by: abhii
2 Replies
2. UNIX for Advanced & Expert Users
I am more of a newbie, but wanted to post this in this forum as I was afraid no one would look at it in unix forums as it concerns shell scripting. I have a shell script that now runs fine with the exclusion of one line:
x=`su nbadmin -c "ssh -t servery /usr/openv/netbackup/bin/bplist -C... (7 Replies)
Discussion started by: newbie2010
7 Replies
3. Shell Programming and Scripting
I want to store the return value of
grep -c string filename
into a variable, say count. How do I do that?
For example if grep -c "string" "filename" shows 0 on executing it in the sh shell then I want to store this 0 in a variable. Is it possible? :D (5 Replies)
Discussion started by: navienavnav
5 Replies
4. Shell Programming and Scripting
I wrote this script
#!/bin/bash
var=`du -sch /var/log/messages;du -sch /var/log/maillog`
echo $var
I am getting result as follows.
# sh my.sh
2.1M /var/log/messages 2.1M total 296K /var/log/maillog 296K total
I need it like below
2.1M /var/log/messages
296K... (3 Replies)
Discussion started by: anilcliff
3 Replies
5. Solaris
Hi,
i'm posting this in the Solaris forum although maybe it should be better in the General unix forum, I'm formatting an output witht he following command:
crontab -l | grep GBOUAT8 | grep UTP | grep -i stop | sed 's/\\//'
08 2 * * 2-6 /apps/sum_glob/gbo_uat/sparse/bin/dmg_cronlaunch -ENVI... (2 Replies)
Discussion started by: Cvg
2 Replies
6. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
7. Shell Programming and Scripting
Hey Folks and Gurus there
I am trying to replicate this logic in bash :
(1) if ; then
function1 parameters &
function2 parameters &
fi
Is there an easy method esp one with regex that can do this comparision.
e.g. $var is compared to this list ( case regardless ) (... (1 Reply)
Discussion started by: sieger007
1 Replies
8. Shell Programming and Scripting
All I want to do is find out if the string 'NO' is in a file by checking for a return code of 0 if there is a match. The grep works fine on the command line directly naming the file but I am obviously not using the correct syntax within the shell script as I consistently get the error message
... (5 Replies)
Discussion started by: SusanDAC
5 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
10. UNIX for Dummies Questions & Answers
If i write this statement in a Korn Shell script
RCODE=$?
what possibly does it eman? (3 Replies)
Discussion started by: ranjita.c
3 Replies