![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| grep command | christine33990 | UNIX for Dummies Questions & Answers | 11 | 05-05-2008 11:45 PM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-04-2007 11:59 PM |
| grep command help | ishmael^soyuz | Shell Programming and Scripting | 4 | 07-11-2007 06:01 AM |
| grep command | pmsuper | UNIX for Dummies Questions & Answers | 6 | 11-22-2006 04:12 AM |
| grep command | debasis.mishra | Shell Programming and Scripting | 1 | 03-27-2006 10:53 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
Hi,
I need to grep two variables at the same time in shell programming. Like today=Dec_16, and $1=5, how can I grep like this: "$today_$1"? Thanks in advance! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Your string makes DEC_165 - are you looking for DEC_15?
or DEC_165? |
|
#3
|
||||
|
||||
|
jim,
I am looking for "DEC_16_5". I'd like $today is replaced by DEC_16 and $1 is replaced by 5. |
|
#4
|
|||
|
|||
|
try something like this
Code:
today="DEC_16" num="5" grep $today"_"$num <filename> |
|
#5
|
||||
|
||||
|
It worked!!!
Thanks for your help!!!! |
|
#6
|
||||
|
||||
|
Sorry for the confusion.
Last edited by whatisthis; 01-31-2005 at 12:27 PM. |
||||
| Google The UNIX and Linux Forums |