![]() |
|
|
|
|
|||||||
| 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 |
| Replacing a string in nth line | maxmave | Shell Programming and Scripting | 1 | 06-04-2008 02:32 PM |
| To cut end string from line | visu | Shell Programming and Scripting | 7 | 12-20-2007 11:22 PM |
| regexp to get first line of string | jonas.gabriel | Shell Programming and Scripting | 3 | 05-09-2007 12:46 AM |
| get the NF of a string line | ozzman | Shell Programming and Scripting | 5 | 02-01-2007 10:01 PM |
| How I Can get String From the Line | habuzahra | UNIX for Dummies Questions & Answers | 2 | 10-29-2006 04:55 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
I'm trying in a script, to add a string after the line number one. file=file.txt text="it works" sed '1i\ $text' < $file But I'm getting the following err: "Function 1i\ $text cannot be parsed." Does anyone knows the reason why this err is happening or knows another way to do it ? Thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Dont use single quotes ('). Use double quotes ("). This will allow the shell to substitute the value of the variable $text in its place.
|
|
#3
|
||||
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|