|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dear All, I am using the grep command.. Code:
bash-3.2$ grep TR2 /mydata/MISE/MAPPLI/USD/mytransfer/_SRY10566_124005.mail | cut -d "/" -f2-|cut -d ":" -f2 The output is Code:
/my_repo/*/MYOPS/SR123/SRY78623/RDM/RY_USD Code:
bash-3.2$ abc=$(grep TR2 /mydata/MISE/MAPPLI/USD/mytransfer/_SRY10566_124005.mail | cut -d "/" -f2-|cut -d ":" -f2) The output is as below Code:
bash-3.2$ echo $abc /my_repo/mine001/MYOPS/SR123/SRY78623/RDM/RY_USD /my_repo/mine001_RO/MYOPS/SR123/SRY78623/RDM/RY_USD I undeestand that now the grep is not doing grep from mail body instead it doing grep on Directory structure.. Please let me how we can restict in... in second Case... I dont want the value /my_repo/mine001_RO/MYOPS/SR123/SRY78623/RDM/RY_USD in second grep case Last edited by Franklin52; 02-21-2013 at 05:47 AM.. Reason: Please use code tags for data and code samples |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Use double quotes Code:
bash-3.2$ abc=$(grep TR2 /mydata/MISE/MAPPLI/USD/mytransfer/_SRY10566_124005.mail | cut -d "/" -f2-|cut -d ":" -f2) Code:
#echo -n "abc=$(grep TR2 /mydata/MISE/MAPPLI/USD/mytransfer/_SRY10566_124005.mail | cut -d "/" -f2-|cut -d ":" -f2)" Last edited by Franklin52; 02-21-2013 at 05:48 AM.. Reason: Please use code tags for data and code samples |
| Sponsored Links | ||
|
![]() |
| Tags |
| grep based on pattern |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Issue in grep | sharad.40216 | Shell Programming and Scripting | 7 | 06-28-2012 04:31 PM |
| Issue with grep | digitalviking | Shell Programming and Scripting | 5 | 04-12-2012 01:27 PM |
| Grep issue | vee_789 | Shell Programming and Scripting | 2 | 01-17-2012 08:11 AM |
| Grep issue | mohtashims | UNIX for Dummies Questions & Answers | 9 | 07-28-2011 04:30 PM |
| Grep Issue | revertback | Shell Programming and Scripting | 7 | 04-12-2010 01:02 AM |
|
|