![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sed
Guys
do you know any other command that will insert a line at particular line number...I used this one...but it is not working if the above lines are blank. This command will put "name=cat.abc.com at 11th line.But if there is no line 10 the command is not working... sed '10a\ name = cat.abc.com' con.txt Really appreciate if you guys can help me out with this...alll i need is a command to put lines (append or insert) at particular line number... Thanks alot CK |
|
||||
|
danmero
Thanks for the code man..its working...but only at the prompt..its not really changing the file...so I tried awk 'NR==11{print "new line"}1' file>file2. But using "file2" is not a feasible solution for me..The change has to happen in "file" itself. do u know a solution that doesnt use file2.Please let me know. --Cal |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|