From owner-freebsd-questions Wed May 7 09:08:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA29144 for questions-outgoing; Wed, 7 May 1997 09:08:20 -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 JAA29113 for ; Wed, 7 May 1997 09:08:15 -0700 (PDT) Received: by mail.EUnet.hu, id SAA16550; Wed, 7 May 1997 18:08:04 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id QAA00767; Wed, 7 May 1997 16:53:58 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199705071453.QAA00767@CoDe.hu> Subject: Re: test To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Wed, 7 May 1997 16:53:57 +0200 (MET DST) Cc: un_x@anchorage.net In-Reply-To: from Steve Howe at "May 6, 97 10:47:23 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 > > according to test(1), > > (expression) should evaluate to true if expression is true, > just as ! expression evaluates to false if expression is false. > > but the () cause syntax problems for me, ie, > > if test (1 = 1); then echo YES!; fi > > > syntax error: expecting ")" ... if test '(' 1 = 1 ')' ; then echo YES! ; fi The '(' is the command groupping character of the shell, and you have to escape it. Bye, 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"