Skip to main content

Thread: sed expression question


good day everyone!
sorry ask how in sed "if 'string1' not exist add 'string2' end of file once"?
thank in advance!

use awk can keep counter/flag signify found.

code:
awk '/string1/{f=1}end{ if (!f) {print "string2"}}1' file
use best tool job.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk sed expression question


Ubuntu

Comments

Popular posts from this blog

How to decompile jsxbin to jsx

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

Phoca Guestbook logger registret bruger af - Joomla! Forum - community, help and support