![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| update a file with values from other file in shell bash | teodora | Shell Programming and Scripting | 1 | 07-03-2008 08:39 AM |
| Converting Binary decimal coded values to Ascii Values | gaur.deepti | UNIX for Advanced & Expert Users | 3 | 04-02-2008 09:33 AM |
| Extract values from log file | wdympcf | Shell Programming and Scripting | 5 | 08-10-2007 12:52 AM |
| taking snapshot of a file | bryan | UNIX for Dummies Questions & Answers | 1 | 09-09-2005 07:42 AM |
| Perl: taking text from a .txt file | perleo | Shell Programming and Scripting | 2 | 06-19-2003 07:23 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
i have a script, whcih takes values from a file and assign it to one variable. this text value contains name of few object. value contains line by lie. i.e. one after another.
when i am assaign the value of this text file to a variable, it accept the value as one liner instead of one by one. pls help me in this. #!/bin/bash exclude="`cat /tmp/excludejobs`" echo $exclude > /tmp/testexclude find /home/bosuser/Production/jil/* | xargs grep /home/bosuser|cut -d "." -f1|cut -d "/" -f6|uniq > /tmp/includejob job="`cat /tmp/includejob`" echo $job > /tmp/testinclude for i in $job do if [ $i != $exclude ] then anjil -sd $job > /tmp/document cat /tmp/documnet | grep 'Team Mail Alias' > /tmp/rawmail cat /tmp/rawmail | cut -d ":" -f2 > /tmp/mailalias /usr/ucb/mail -s "notification" xx@yyyyy.com fi here the value takes as one liner instead of one by one. in csh sheel we have "foraech" command but in bash how can i fullfill this Last edited by DukeNuke2; 4 Weeks Ago at 10:23 PM. Reason: changed email |
| Forum Sponsor | ||
|
|
|
|||
|
tht has been resolved.. any way thaks for your reply. i have another query.
I have a file , which having the following out put insert_job: PS_PositivePayBox job_type: b insert_job: PS_PositivePay_MOBox job_type: b insert_job: PS_PositivePay_MO_norun job_type: c owner: bosuser insert_job: PS_PositivePay_MO_Watch job_type: f insert_job: PS_Wait_MO job_type: c owner: bosuser insert_job: PS_Fetch_MO job_type: c insert_job: PS_Notify_MO job_type: c owner: bosuser insert_job: PS_PositivePay_BWBox job_type: b insert_job: PS_PositivePay_BW_norun job_type: c owner: bosuser insert_job: PS_PositivePay_BW_Watch job_type: f I need to find all the insert_job line, which comes above owner: bosuser For eg. insert_job: PS_PositivePay_BW_norun job_type: c owner: bosuser I need the , “ insert_job: PS_PositivePay_BW_norun job_type: c” What can be the command |
|
||||
|
Use,
Code:
grep -B 1 "owner: bosuser" {filename}
Quote:
|
||||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|