0

I have this text in /etc/bash.bashrc:

alias dwa='bash /opt/dwa.sh'

I tried to delete it with the following (and similar commands):

sed -i 'alias dwa=\'bash /opt/dwa.sh\'/d' /etc/bash.bashrc

Why did my sed operation fail?

2 Answers2

1

Why search and replace when you can delete?

sed --in-place '/^alias dwa=/d' /path/to/file
DopeGhoti
  • 76,081
-2
awk '!/alias dwa/{print $0}' filename
grg
  • 197