Cy Schubert:
> In message <240137891.21754.1749997280448@localhost>, Ronald Klop writes:
[...]
> > > +       if [ "$vfstype" = "zfs" -a "$a" != "#" ]; then
> >
> > Does this mean that a comment # must always be folllowed by a whitespace?

> Yes. It's a hack but it's the only way without grep (when /usr may not be 
> mounted). In the very worst case rc.d/zpool will be needlessly executed.

could you not check for a comment using the # variable expansion operator?
i.e. if [ "${a#\#}" != "$a" ] then the variable starts with a # character:

$ echo $line1
#Foo bar
$ echo $line2
Foo bar
$ echo $line3
Foo # bar
$ [ "${line1#\#}" = "$line1" ] || echo comment
comment
$ [ "${line2#\#}" = "$line2" ] || echo comment
$ [ "${line3#\#}" = "$line3" ] || echo comment
$

Attachment: signature.asc
Description: PGP signature

Reply via email to