Shell csh: using regular expression in string

I'm trying to define a string in a following way but get a no match error:
Code:
/home/ds941545[1115] set a = 'error.*done'
/home/ds941545[1116] echo $a
echo: No match.
How should I define the string in this case?
Thanks
 
Use setenv(1):
Code:
dice@armitage:~ % echo $SHELL
/bin/tcsh
dice@armitage:~ % setenv foo 'bar'
dice@armitage:~ % echo $foo
bar

With csh(1)/tcsh(1) set(1) is used to set certain settings for the shell.

How should I define the string in this case?
Semantics but you don't define a string, you define a variable and assign a string to it.
 
It still doesn't work. The issue is usage of a wildcard in string definition:
Code:
/home/ds941545[1161] setenv aaa 'error.*done'
/home/ds941545[1162] echo $aaa
echo: No match.
Regards
 
Hehe.. The weirdness of the C shell. The shell is trying to use filename substitution because the string contains an asterisk.

Code:
dice@armitage:~ % setenv aaa 'error.*done'
dice@armitage:~ % echo $aaa
echo: No match.
dice@armitage:~ % echo "$aaa"
error.*done
dice@armitage:~ % touch error.something.done
dice@armitage:~ % echo $aaa
error.something.done
dice@armitage:~ % ls -l error.*done
-rw-r--r--  1 dice  dice  0 Jul  3 12:11 error.something.done
 
Hehe.. The weirdness of the C shell. The shell is trying to use filename substitution because the string contains an asterisk.

Code:
dice@armitage:~ % setenv aaa 'error.*done'
dice@armitage:~ % echo $aaa
echo: No match.
dice@armitage:~ % echo "$aaa"
error.*done
dice@armitage:~ % touch error.something.done
dice@armitage:~ % echo $aaa
error.something.done
dice@armitage:~ % ls -l error.*done
-rw-r--r--  1 dice  dice  0 Jul  3 12:11 error.something.done
Thanks.
It works.
 
Back
Top