10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I'm trying to catch a particular process (XYZ) running using a ksh script. Like So..
VarPS=`ps -ef |grep XYZ |grep -v grep`
However this seems to find the process of the script itself - not the process 'XYZ'
Asked in Error - I found my own typo...
thanks anyway Skrynesaver (1 Reply)
Discussion started by: Mudshark
1 Replies
2. Shell Programming and Scripting
I want to search a file if it contains special strings and if yes, the records found should be mailed.
I can either do it with a temporary file:
/usr/bin/grep somestring somefile > /tmp/tempfile && /usr/bin/mail -s "Found something" email@mycomp.com < /tmp/tempfile... or by running the grep... (10 Replies)
Discussion started by: Cochise
10 Replies
3. Shell Programming and Scripting
i have this line of code that looks for the same file if it is currently running and returns the count.
`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`
basically it is assigned to a variable
ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I have input file with queue names
No.esprd.Queue|No.esdev.Queue|||n|120|No_User||No_User|
No.esdev.Queue|No.esdev.Queue|||n|120|No_User||No_User|
I have to check if the input file contains word "esprd" and the number of times it occurs. I will have to do further... (22 Replies)
Discussion started by: Green_Star
22 Replies
5. Shell Programming and Scripting
Hi,
I would like to know how can i pipe the following output of grep into a predefined output format
This is the output of the grep command grep record *.txt | sort -r
2010-04-28-11-12-21.txt:C The user has created a record
2010-04-29-10-18-41.txt:U The user has updated a record... (8 Replies)
Discussion started by: alienated
8 Replies
6. Shell Programming and Scripting
In file.name, I have a line that reads
$IDIR/imgen -usemonths -dropcheck -monitor -sizelimit 80000000 -interval 120 -volcal HSI
How can I get the size limit, i.e. 80000000 out and pass it to a variable called SIZE?
Thanks. I tried
echo "grep sizelimit file.name" | sed -n -e... (3 Replies)
Discussion started by: rodluo
3 Replies
7. Shell Programming and Scripting
I am running on SunOS, KSH
For my script , I want to test if a file contain
'PLS' OR 'ORA' OR 'ERROR'
Can we do it in one line using grep ???
currently i am using something like below.
ERROR_CHK () {
ERR_DATA="$ABC"
if $(echo "$ABC" | grep ERROR) ;then
echo "Failed: Can't... (4 Replies)
Discussion started by: Amresh Dubey
4 Replies
8. Shell Programming and Scripting
Hi,
I'd like to grep two variables that are seperated with one space in ksh.
var1="Feb"
var2="09"
I tried to grep "$var1 ""$var2" /usr/file
It turn into grep Feb 09 /usr/file when it runs.
I got error.
Can some one help me with this one?
Thanks a lot for your help! (4 Replies)
Discussion started by: cin2000
4 Replies
9. Shell Programming and Scripting
Hi,
is there problem with grep command when using ksh?
I had the below command:
/usr/bin/grep \""$Mon $NewDD\"" /tmp/timemanager/intlog.$$ >> /tmp/timemanager/log.$$ 2>/dev/null
when I run ksh in debug mode, this command can not grep anything even the data is in the file.
+ /usr/bin/grep... (3 Replies)
Discussion started by: cin2000
3 Replies
10. Shell Programming and Scripting
How can I extract the 9th line of a text file.
thanks vm.:confused: (2 Replies)
Discussion started by: hoang
2 Replies