*BSD News Article 35182


Return to BSD News archive

Xref: sserve comp.unix.user-friendly:2826 comp.unix.solaris:22112 comp.unix.programmer:19678 comp.unix.misc:13723 comp.unix.aux:15270 comp.unix.bsd:14780 comp.unix.aix:43374
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!wabbit.cc.uow.edu.au!picasso.cssc-syd.tansu.com.au!newshost!chrisb
From: chrisb@wombat.cssc-syd.tansu.com.au (Chris Bitmead)
Newsgroups: comp.unix.user-friendly,comp.unix.solaris,comp.unix.programmer,comp.unix.misc,comp.unix.aux,comp.unix.bsd,comp.unix.aix
Subject: Re: Shell wars
Date: 31 Aug 94 10:44:08
Organization: Telecom Australia - CSSC
Lines: 34
Distribution: inet
Message-ID: <CHRISB.94Aug31104408@wombat.cssc-syd.tansu.com.au>
References: <33af70$8rd@usenet.INS.CWRU.Edu> <33gvms$56a@wombat.cssc-syd.tansu.com.au>
	<33jk6l$6cq@hamlet.umd.edu>
	<CHRISB.94Aug29144419@wombat.cssc-syd.tansu.com.au>
	<33vj8d$b4i@sprocket.csv.warwick.ac.uk>
NNTP-Posting-Host: wombat.cssc-syd.tansu.com.au
In-reply-to: cudcv@csv.warwick.ac.uk's message of 30 Aug 1994 16:29:17 +0100

In article <33vj8d$b4i@sprocket.csv.warwick.ac.uk> cudcv@csv.warwick.ac.uk (Rob McMahon) writes:

>In article <CHRISB.94Aug29144419@wombat.cssc-syd.tansu.com.au>,
>chrisb@wombat.cssc-syd.tansu.com.au (Chris Bitmead) writes: 

>>I'll be the first to back up BSD in many areas, but csh would not be one of
>>them. The design flaws in csh are well documented. What is it that you can do
>>in csh that you can't do in the bourne flavoured shells?
>
>The thing I really miss in sh is
>
>set lpargs = ( $lpargs:q $nextarg:q )
>
>i.e. some decent way of forming lists without causing problems with spaces,
>quotes, and backslashes.  Lists are useful throughout csh, and there really is
>no good substitute in sh.

I agree that arrays in sh would be nice, but they can still be done quite
easily with no space problems.
e.g., to set three items in an array to the value of $XXX (which may have
spaces):

XXX='x y z'
for i in 1 2 3
do
eval "MYVAR$i="'$XXX'
done

set | grep MYVAR

MYVAR1=x y z
MYVAR2=x y z
MYVAR3=x y z