Thread Regex in Shellskripten (14 answers)
Opened by renee at 2004-02-03 13:05

ptk
 2004-02-03 13:55
#96502 #96502
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
set variable = sc

# Variante 1
echo $variable | grep -q ^sc
if ($? == 0) then
echo yes
else
echo no
endif

# Variante 2
switch ("$variable")
case "sc*":
echo yes
breaksw
default:
no
endsw

View full thread Regex in Shellskripten