I want to pass a command to a shell script. This command is a grep command. At runtime, I get the following errors, please help:
myscript.sh "egrep 'ERROR|FATAL' \*20100428\*.log | grep -v aString"
myscript.sh is a simple script:
#!/bin/ksh cd log $1
errors:
egrep: can't open | egrep: can't open grep egrep: can't open -v egrep: can't open aString
The error is that egrap sees |, grep, -v and aString as arguments.
source share