![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Double Substitution variables in ksh | xiamin | Shell Programming and Scripting | 19 | 05-23-2007 04:35 AM |
| KSH variable substitution | tipsy | Shell Programming and Scripting | 5 | 08-14-2006 05:07 PM |
| Variable Substitution | garak | Shell Programming and Scripting | 2 | 03-16-2006 08:55 PM |
| variable substitution | ck-18 | UNIX for Dummies Questions & Answers | 1 | 05-16-2003 08:44 AM |
| Substitution in a variable | spragueg | UNIX for Advanced & Expert Users | 3 | 10-18-2001 09:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Code:
eval sed -n '/'\$var_$name'/p' < myfile notice the difference: # myvar="foo" # var='$myvar' # echo $var $myvar # eval echo $var foo The next to last line will first evaluate to "eval echo $myvar", then eval will restart the evaluation process resulting in "echo foo", which is in turn being displayed. bakunin |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|