Code editing feauture
Helmut Hullen
Hullen at t-online.de
Thu Apr 24 14:26:00 UTC 2008
Hallo, Michelle,
Du (linux4michelle) meintest am 23.04.08:
>> case `echo $1 |sed 's/^.*\.//'` in
>> c|h)
[...]
> The `echo $1 |sed 's/^.*\.//'` is striping the prefix/name from the
> filename. E.g.
> echo main.c |sed 's/^.*\.//'
> will result in
> c
Better readable:
case "$1" in
*.c|*.h)
# do something
;;
esac
I should test if "case" makes "globbing" (with ? as 1-char-joker) or
"regex" (with . as 1-char-joker) ...
Viele Gruesse!
Helmut
More information about the mc
mailing list