I have posted a question earlier about this but now I understand the problem and thus want to repost. The * character is correctly interpreted in my csh script when not put in double quotes, but when I put it in double quotes, it is not correctly interpreted. Does anyone know how to make csh correctly interpret the * character. Below is my code:
#!/bin/csh
#set ans=`grep -E hello\*i ~/wildcard/helloi.txt`
set ans=`grep -E "hello\*i" ~/wildcard/helloi.txt`
echo $ans
The commented set ans works fine but the uncommented one does not. The input file contains the following :
helloiif
helli
helloi
All 3 should be printed.