Skip to main content

Thread: writing string to specific line


i want put text string in file using method on specific line


line number 30

text put %this location /var/www/filename

quote posted aliahsan81 view post
i want put text string in file using method on specific line


line number 30

text put %this location /var/www/filename
you can use 'sed':

code:
sed -i '4i\  hi' file
adds "hi" line 4 in file "file".

should happen if there less 30 lines in file?


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk writing string to specific line


Ubuntu

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code