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: '|'
Why?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityWhen 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: '|'
Why?
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