![]() |
|
|
|
|
|||||||
| 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. |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
sed help again
I am trying to insert a line after a line whose value is stored in a variable $LASTLINE
sed "/$LASTLINE/a\newuser $user" $file > $file.new This should insert a line starting with 'newuser' followed by 10 spaces and then $user the value of which the user will enter. But the above command does not work. Any help is appreciated. Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Why doesn't the command work?
Is the "user" variable set? a is append... not insert.... Please be more specific about why the command isn't working as you'd expect. Cheers ZB |
|
#4
|
||||
|
||||
|
Indeed. Duplicate post. Thread closed.
|
||||
| Google The UNIX and Linux Forums |