Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 1997 10:56:29 -0800 (AKDT)
From:      Steve Howe <un_x@anchorage.net>
To:        Zahemszky Gabor <zgabor@CoDe.hu>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>, un_x@anchorage.net
Subject:   Re: Xterm/shell diff
Message-ID:  <Pine.BSF.3.95q.970526101356.24302A-100000@aak.anchorage.net>
In-Reply-To: <199705260855.KAA00750@CoDe.hu>

next in thread | previous in thread | raw e-mail | index | archive | help

> >  if [ "`expr $j : '.*\.\(.*\)'`" = gz ]; then echo hi!; fi
> > 
> > if i remove the double-quotes from the test, an Xterm gives me the
> > error "]: syntax error", but a ttyv* doesn't complain.

> 1) what's value of j

j=$1

> 2) was it the correct error message?  (I've got [: syntax error
> + expr: syntax error only when I made j unset)

you are correct.  i may have made the mistake of testing on two different
files.  one called "a" in my Xterm and one called ".profile" in my vty.
the "expr" came up empty with "a", but not with ".profile", which caused
the error.  i also may have missed it because the vty is faster than my
Xterm (i was using the code to load an application, so i could only see
the error briefly).  thanks.

hopefully someday i'll get the hang of this!
btw = this code strips prefixes ( equal to ${j##*.} ).
-------------------------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970526101356.24302A-100000>