From owner-freebsd-questions Mon May 26 12:17:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA05895 for questions-outgoing; Mon, 26 May 1997 12:17:31 -0700 (PDT) Received: from iceberg.anchorage.net. (root@iceberg.anchorage.net [207.14.72.150]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id MAA05890 for ; Mon, 26 May 1997 12:17:28 -0700 (PDT) Received: from aak.anchorage.net (ai-134 [207.14.72.134]) by iceberg.anchorage.net. (8.6.11/8.7.3) with SMTP id KAA06931; Mon, 26 May 1997 10:14:10 -0800 Date: Mon, 26 May 1997 10:56:29 -0800 (AKDT) From: Steve Howe X-Sender: abc@aak.anchorage.net To: Zahemszky Gabor cc: FreeBSD questions , un_x@anchorage.net Subject: Re: Xterm/shell diff In-Reply-To: <199705260855.KAA00750@CoDe.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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##*.} ). -------------------------------------------------------------------------