When i put this code in terminal:

sed -i "|^if [[ -f /etc/skel/.bashrc ]]; then . /etc/skel/.bashrc; fi|d" ~/.bashrc

I obtain:

sed: -e expression #1, char 1: unknown command: '|'



You have to indicate that you are using a different separator in sed delete command by prepending a backslash \ before the new separator:

sed '\|text|d' file

See selecting lines by text matching in GNU Sed manual.

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.