*BSD News Article 35549


Return to BSD News archive

Xref: sserve comp.unix.user-friendly:2864 comp.unix.solaris:22632 comp.unix.programmer:19925 comp.unix.misc:13838 comp.unix.aux:15452 comp.unix.bsd:14861 comp.unix.aix:43862
Newsgroups: comp.unix.user-friendly,comp.unix.solaris,comp.unix.programmer,comp.unix.misc,comp.unix.aux,comp.unix.bsd,comp.unix.aix
Path: sserve!newshost.anu.edu.au!munnari.oz.au!cs.mu.OZ.AU!mrg
From: mrg@mame.mu.OZ.AU (matthew green)
Subject: Re: xargs and alias commands
Message-ID: <mrg.778904672@dynamo>
Sender: news@cs.mu.OZ.AU
Organization: Computer Science, University of Melbourne, Australia
X-Newsreader: NN version 6.5.0 #4
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>
Date: Wed, 7 Sep 1994 02:24:32 GMT
Lines: 50

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.
   
   >   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.
   
   >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.

.mrg.