3

need help - how to delete the line from the file if the last char is - ":" with sed , on Solaris machine

for example sed will remove the following line (include the black line)

      /etc/val/config/globals.xml:/globals/CLUSTERNODES/node:

example what not need to delete

      /etc/val/config/globals.xml:/globals/CLUSTERNODES/node:node1a
5
sed -e '/:$/d' < foo > foo.new

will do the job (just tested it on Solaris 8, and it seems fine).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.