Monday, July 11, 2011

inserting at a particular line no shell

content of hello.data file before insertion:

acer@ubuntu:/tmp$ cat hello.data
hello
how are you
wonderful
great awesome
May be might be

Script file:

acer@ubuntu:/tmp$ cat dd.sh
#!/bin/bash
sed -i '5ikarthik' /tmp/hello.data 

acer@ubuntu:/tmp$ ./dd.sh

Content of hello.data file after insertion:

acer@ubuntu:/tmp$ cat hello.data
hello
how are you
wonderful
great awesome
karthik
May be might be
acer@ubuntu:/tmp$

No comments:

Post a Comment