Return to BSD News archive
Xref: sserve comp.unix.user-friendly:2866 comp.unix.solaris:22684 comp.unix.programmer:19940 comp.unix.misc:13845 comp.unix.aux:15465 comp.unix.bsd:14863 comp.unix.aix:43901 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: xargs and alias commands Date: 8 Sep 94 14:54:39 Organization: Telecom Australia - CSSC Lines: 65 Distribution: inet Message-ID: <CHRISB.94Sep8145439@wombat.cssc-syd.tansu.com.au> References: <33af70$8rd@usenet.INS.CWRU.Edu> <33e3kt$i1i@wombat.cssc-syd.tansu.com.au> <CHRISB.94Aug29144419@wombat.cssc-syd.tansu.com.au> <34022k$4lu@news.cerf.net> <CHRISB.94Sep2111736@wombat.cssc-syd.tansu.com.au> <mrg.778672248@dynamo> <CHRISB.94Sep5125336@wombat.cssc-syd.tansu.com.au> <mrg.778904672@dynamo> NNTP-Posting-Host: wombat.cssc-syd.tansu.com.au In-reply-to: mrg@mame.mu.OZ.AU's message of Wed, 7 Sep 1994 02:24:32 GMT In article <mrg.778904672@dynamo> mrg@mame.mu.OZ.AU (matthew green) writes: >chrisb@wombat.cssc-syd.tansu.com.au (Chris Bitmead) writes: > > > In standard bourne shell you can write a function: > > If you like csh behaviour then enter this function: > > > > setenv() > > { > > eval "$1=$2" > > export "$1" > > } > > > >um, this is *not* portable sh. > > Why not? What bourne shell will this function not work on? Very old shells > without functions perhaps, but they don't count. > >why do they not count? ultrix still uses a V7 /bin/sh (though, >it does have a /bin/sh5 or something ..) portable sh, to me, >means making it work on all the sh's that you're likely to run >into. ultrix (sadly, you might say), is fairly common, so you're >fairly likely to run in to it. Well I've used about 8 or so different versions of unix now and they all had functions. Gee, even xenix had functions. Admittedly I haven't used Ultrix but so what? You admit they have a /bin/sh5 so use that. The fact that Ultrix's shell doesn't have functions might stop me utilising them in an install script, but not for interactive use surely? > > > setenv MYVAR xxx > > > > env | grep MYVAR > > > >this is not using 'sh', but rather an external 'env' program. > > The whole point of using shells is to be able to start processes to do the > work for you. Why do you want every feature in the universe built into the > shell when a program will do just as well? > >the point being here that there is not way in sh for *it* to tell >you what the environment variables are, which was the original >posters point. i am not trying to say that this is nessicarily >bad - it just is. And my point was that the original poster's question was foolish. Why should you need to do this in the shell? Shells are supposed to have minimum built in functionality. > >personally, i think all the current shells suck. i use tcsh because > >i'm comfortable in it and it mostly does `what i need' (not to be > >confused with `what i think i need'), but i'd rather a V7 sh to csh > >anyday. > > Then use a V7 sh. > >did you miss where i said 'i use tcsh' ? tcsh is so vastly >different to csh that they are at opposite ends of my prefered >shell list. the point i was making is that bare csh is not >something i like. Yes, I missed your point, but tcsh suffers from many of the design flaws of the original csh.