I wanted to capture to a file the errors being returned on the command line from
grep. For example,
grep foo.lookup No such file in directory
I want to output that to a log file. This is my shell script:
lookUpVal=1 var1=$(grep $lookUpVal foo.lookup) >>lookup.log 2>$1
It creates the file
lookup.log but doesn't write the error on it.