10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file with data like this. I want to look for MultiLoad and pull that line and the line above. I cant use the grep -B 1 I dont have that version and cant install on the server. is there a awk or perl that will do it.
"CMPGN_RPT_DEV_TT"."text1" (TableId 0029H 5CEEH)
bypassed due to... (4 Replies)
Discussion started by: wambli
4 Replies
2. Shell Programming and Scripting
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
Discussion started by: arunshankar.c
3 Replies
3. UNIX for Dummies Questions & Answers
Hello , this is my first topic cause I need your little help:(
I got .txt file, and I want to find lines without letter 'a', so im writing:
grep "" list.txt (list.txt is the file of course)
and i have no idea why it's not working because it shows lines with a. (1 Reply)
Discussion started by: bbqtoss
1 Replies
4. Shell Programming and Scripting
I have ASCII files to parse that 48 hours old or more ; I can identify them like so
find . -name "FILE*TXT" -mtime +1 -exec ls -ltas '{}' ';'
Some files have a list of hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to... (3 Replies)
Discussion started by: alan
3 Replies
5. UNIX for Advanced & Expert Users
Hi,
in a script I will do :
grep ORA- mylogfile.log
If it returns any ORA- (oracle error) I whant to have :
echo "subject : RMAN in Error " >> /appli/rap.txt
But if no error
echo "subject : RMAN OK " >> /appli/rap.txt
Can you help me ?
The grep return code would it be... (1 Reply)
Discussion started by: big123456
1 Replies
6. UNIX for Dummies Questions & Answers
Hi
Is there any way GREP command can return word and not complete line.
My file has following data:
Hello Everyone I am NitinrajSrivastava
Hi Friends Welcome VrajSrivastava
I am using grep 'raj' which is returning me complete line.However I want only the word having keyword 'raj'.
Required... (11 Replies)
Discussion started by: dashing201
11 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I looking to use grep to return a string with exactly n matches.
I'm building off this:
ls -aLl /bin | grep '^.\{9\}x' | tr -s ' '
-rwxr-xr-x 1 root root 632816 Nov 25 2008 vi
-rwxr-xr-x 1 root root 632816 Nov 25 2008 view
-rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
Discussion started by: MykC
7 Replies
8. Shell Programming and Scripting
Hi guys,
I currently use the below mwntioned grep statemen to get the timestamp of the last generated file in the directory.
(ls -ltr eCustomerCME* | grep ^- | tail -1 | awk ' { print $6,$7,$8 } ')
I need to modify this grep to search for files generated only within last 2 hrs. Can you pls... (5 Replies)
Discussion started by: ragha81
5 Replies
9. Shell Programming and Scripting
hi,
i am running this command inside the script
var=`grep -il $1 "${logdir}"* | xargs grep -ivl adding | xargs grep -ivl equation | xargs ls -ctr | tail -1`
in that grep will find the latest logfile for the variable "$"
if it fnd the logfile, then it reutrns the filename to the var
if... (1 Reply)
Discussion started by: mail2sant
1 Replies
10. UNIX for Dummies Questions & Answers
Hey guys,
I just want to grep for a line then return a few lines above it I can't seem to find what im looking for on google can someone help me out?
This is on Solaris 9.....
I don't have GNU grep so -B and -A commands will not work (3 Replies)
Discussion started by: kingdbag
3 Replies