How do I execute a command containing a double quote ?
I pass a variable to grep that contains spaces, so I need to quote it,
but it does not work.
#!/usr/bin/ksh
set -x
txt='"next to"'
cmd="grep $txt ~dpearso5/file2"
echo $cmd
$cmd
This is the error I get:
+ grep "next to" ~dpearso5/file2
grep: 0652-033 Cannot open to".
grep: 0652-033 Cannot open ~dpearso5/file2.