I have a requirement to search for a variable "nt" ( contains a slash). From a file text1 and remove all lines containing it
$ echo $nt /u01/app/us1fa01_0/ $ cat text1 /u01/app/fa01/ /u01/app/us1fa01_0/ /u01/app/us1fa01_ps6/
$ cat text1 /u01/app/fa01/ /u01/app/us1fa01_ps6/
I tried the following commands:
sed "/$nt/d" text1
sed: -e expression #1, char 3: unknown command: `u'
sed "|$nt|d" text1
sed: -e expression #1, char 1: unknown command: `|'
sed '\|"$nt"|d' text1
/u01/app/fa01/ /u01/app/us1fa01_0/ /u01/app/us1fa01_ps6/
None of the above codes seem to work. Looking for a way out