![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing commands in $variables. | Paulw0t | Shell Programming and Scripting | 7 | 08-08-2008 06:42 PM |
| Using variables in sed commands | hcclnoodles | Shell Programming and Scripting | 2 | 01-02-2007 08:56 AM |
| Referencing variables in commands | mharley | Shell Programming and Scripting | 3 | 03-31-2005 02:37 AM |
| Subtracting Variables which are commands | Astudent | UNIX for Dummies Questions & Answers | 2 | 03-30-2001 10:55 AM |
| Subing Variables with commands. | Astudent | UNIX for Dummies Questions & Answers | 1 | 02-26-2001 05:02 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Using variables within awk/sed commands
Can I use my own variables within awk and sed for example:
I've written a while loop with a counter $i and I want to use the value of $i within sed and awk to edit certain lines of text within a data file. I want to use : sed '1s/$/texthere/g' data.csv Like this: sed '$is/$/$age/g' data.csv but it only displays the name of the variable not the value it contains. $age is the result of a calculation created within the while loop that I would like to append to the end of each line. Any help is greatly appreciated ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|