![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| redirect the grep output into the variable | mail2sant | Shell Programming and Scripting | 1 | 04-08-2008 06:46 AM |
| Set a variable from awk output | Cranie | UNIX for Dummies Questions & Answers | 3 | 10-11-2007 06:39 AM |
| output of grep | useless79 | Shell Programming and Scripting | 3 | 09-18-2007 02:36 AM |
| how to output awk to a variable | bashirpopal | UNIX for Dummies Questions & Answers | 4 | 04-02-2003 08:02 AM |
| capturing the output of grep as integer variable | babariba | UNIX for Dummies Questions & Answers | 2 | 11-16-2001 07:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Put the output of grep in a variable
Hi,
in a shell script how can I put the result of a grep command in a variable : myvariable=grep mystring myfilename Thank you. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
myvariable=$(grep mystring myfilename)
|
|
#3
|
||||
|
||||
|
Hmmm...
I would have said: myvariable=`grep mystring myfilename` |
|
#4
|
|||
|
|||
|
Thanks to all.
|
|||
| Google The UNIX and Linux Forums |