From owner-freebsd-questions Mon May 26 03:13:51 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA10299 for questions-outgoing; Mon, 26 May 1997 03:13:51 -0700 (PDT) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA10293 for ; Mon, 26 May 1997 03:13:47 -0700 (PDT) Received: by mail.EUnet.hu, id MAA28227; Mon, 26 May 1997 12:13:38 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id KAA00750; Mon, 26 May 1997 10:55:41 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199705260855.KAA00750@CoDe.hu> Subject: Re: Xterm/shell diff To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Mon, 26 May 1997 10:55:40 +0200 (MET DST) Cc: un_x@anchorage.net In-Reply-To: from Steve Howe at "May 24, 97 04:39:24 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > is there a good reason an Xterm and ttyv* window should behave > differently? > > 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. > > what's going on? Maybe pilot error. I've 2.1.5, and tried it on ttyv1 under sh, and on an xterm under sh. Nothing different. So: 1) what's value of j 2) was it the correct error message? (I've got [: syntax error + expr: syntax error only when I made j unset) Gabor -- #!/bin/ksh Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X"