[comp.unix.questions] Is my shell broken or what?

phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) (06/07/91)

Here is the session example:

Script started on Thu Jun  6 23:45:07 1991
phil@ux1:/cso/staff/phil 1> set test = one
phil@ux1:/cso/staff/phil 2> set test2 = two
phil@ux1:/cso/staff/phil 3> echo ${test}
one
phil@ux1:/cso/staff/phil 4> echo ${test2}
Variable syntax.
phil@ux1:/cso/staff/phil 5> exit
phil@ux1:/cso/staff/phil 6>
script done on Thu Jun  6 23:45:45 1991

I cannot find anywhere in the man pages (I did look) where it says that
digits cannot be used in variable names when the ${name} form is used.

System is a Sequent Symmetry.  Version gives:

DYNIX(R) V3.0.17.7  Wed Oct 18 13:31:22 PDT 1989

I have seen before where things like csh have little bugs here or there
that are different from vendor to vendor.  Are the vendors getting into
the code and changing stuff?
-- 
 /***************************************************************************\
/ Phil Howard -- KA9WGN -- phil@ux1.cso.uiuc.edu   |  Guns don't aim guns at  \
\ Lietuva laisva -- Brivu Latviju -- Eesti vabaks  |  people; CRIMINALS do!!  /
 \***************************************************************************/

rickert@mp.cs.niu.edu (Neil Rickert) (06/07/91)

In article <1991Jun7.045124.26811@ux1.cso.uiuc.edu> phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:
>Here is the session example:
>
>Script started on Thu Jun  6 23:45:07 1991
>phil@ux1:/cso/staff/phil 4> echo ${test2}
>Variable syntax.

  Try this one:

Script started on Fri Jun  7 06:53:55 1991
rickert 1> set test2=two
rickert 2> echo ${test2}
Variable syntax.
rickert 3> history
     1  set test2=two
     2  echo 2${test}
     3  history

 The history output gives at least a hint as to how csh is going astray.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940

boyd@prl.dec.com (Boyd Roberts) (06/07/91)

In article <1991Jun7.115837.8545@mp.cs.niu.edu>, rickert@mp.cs.niu.edu (Neil Rickert) writes:
> rickert 2> echo ${test2}
> Variable syntax.

Don't you just hate it when the syntax is `variable' :-)

Avoid C shell, use `rc':

    ; '{([<*>])}2' = stuff
    ; echo $'{([<*>])}2'
    stuff
    ;

Variable names?  No problem.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''

mg@sbsvax.cs.uni-sb.de (Michael Greim) (06/10/91)

In article <1991Jun7.045124.26811@ux1.cso.uiuc.edu>, phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:
> Here is the session example:
> 
[...]
> phil@ux1:/cso/staff/phil 4> echo ${test2}
> Variable syntax.
[...]
> 
> I have seen before where things like csh have little bugs here or there
> that are different from vendor to vendor.  Are the vendors getting into
> the code and changing stuff?

It's a well known bug in csh.
If you play around a little you will notice that the handling of
names differs in "foreach", $-expansion, "set" ... constructs.
I have fixed it some years ago, and if you are lucky enough to have source,
you can apply the patches available at our ftp-server cs.uni-sb.de
(134.96.252.31) in /pub/bsd/csh.

	-mg
-- 
 .-. .-.  .-.  Michael Greim
(   X   )( __) e-mail : mg@cs.uni-sb.de
 \ / \ /  \ /  or     : ...!uunet!unido!sbsvax!mg
  ~   ~    ~

greywolf@unisoft.UUCP (The Grey Wolf) (06/19/91)

/* <1991Jun7.140828.20332@prl.dec.com> by boyd@prl.dec.com (Boyd Roberts)
 * In article <1991Jun7.115837.8545@mp.cs.niu.edu>, rickert@mp.cs.niu.edu (Neil Rickert) writes:
 * > rickert 2> echo ${test2}
 * > Variable syntax.
 * 
 * Don't you just hate it when the syntax is `variable' :-)

That C shell bug is pretty prevalent -- no version doesn't do that right.
(I could probably hack up a fix, but it'd have to wait for BSD 4.4)...

My shell tells me:
Your variable has an identity crisis.

 * 
 * Avoid C shell, use `rc':
 *

Is rc publicly available?  I seem to remember seeing it fly around...

 *     ; '{([<*>])}2' = stuff

..exCUSE me?

 *     ; echo $'{([<*>])}2'
 *     stuff

Eeyagh.

 *     ;
 * 
 * Variable names?  No problem.
 * 
 * 
 * Boyd Roberts			boyd@prl.dec.com
 * 
 * ``When the going gets wierd, the weird turn pro...''

As is evidenced above by the (ab)use of rc above.

Beats the hell out of any other shell I've seen!

boyd@prl.dec.com (Boyd Roberts) (06/19/91)

In article <3528@unisoft.UUCP>, greywolf@unisoft.UUCP (The Grey Wolf) writes:
> 
> Is rc publicly available?  I seem to remember seeing it fly around...

Yes, it was posted to comp.sources.misc in May.  It's the Tom Duff
Plan 9 shell written by Byron Rakitzis <byron@archone.tamu.edu>.

You'll need an ANSI compiler, but it compiles and works fine.
I have it going on my 3max and VAXen at PRL.  It's small and
it's fast and the code _can be understood by one person_.

I think Byron is going to release the next version soon.
There have been some minor bugs which have been fixed.

It's real neat:

  prl313 ; '<3528@unisoft.UUCP>, greywolf@unisoft.UUCP (The Grey Wolf)'=foo
  prl313 ; echo $'<3528@unisoft.UUCP>, greywolf@unisoft.UUCP (The Grey Wolf)'
  foo

All the quoting woes are gone.  Things are evaluated only one.  There
is only type of quote, '...', and backslash is used only to quote new-lines.
Getting a single quote inside a quoted string is a bit weird, though.

UNIX signals are functions, which really cleans up the way signal
handling is done.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''

alan@ukpoit.co.uk (Alan Barclay) (06/21/91)

In article <1991Jun19.095601.24906@prl.dec.com> boyd@prl.dec.com (Boyd Roberts) writes:
>In article <3528@unisoft.UUCP>, greywolf@unisoft.UUCP (The Grey Wolf) writes:
>> 
>> Is rc publicly available?  I seem to remember seeing it fly around...
>
>Yes, it was posted to comp.sources.misc in May.  It's the Tom Duff
>Plan 9 shell written by Byron Rakitzis <byron@archone.tamu.edu>.
>
>You'll need an ANSI compiler, but it compiles and works fine.
>I have it going on my 3max and VAXen at PRL.  It's small and
>it's fast and the code _can be understood by one person_.
>

Just in case anyone is interested, I backed it to K&R without very much
effort, the only major problem was with the variable arguments stuff
and even that was only a hour or so's work.

-- 
  Alan Barclay
  iT                                |        E-mail : alan@ukpoit.uucp
  Barker Lane                       |        BANG-STYLE : .....!ukc!ukpoit!alan
  CHESTERFIELD S40 1DY              |        VOICE : +44 246 214241

tif@doorstop.austin.ibm.com (Paul Chamberlain) (06/24/91)

In article <1991Jun21.153058.17535@ukpoit.co.uk> alan@ukpoit.co.uk (Alan Barclay) writes:
>Just in case anyone is interested, I backed it to K&R without very much
>effort, the only major problem was with the variable arguments stuff
>and even that was only a hour or so's work.

And I bet you've got a gazillion requests already, how about posting
the diffs somewhere?

Paul Chamberlain | I do NOT speak for IBM.          IBM VNET: PAULCC AT AUSTIN
512/838-9748     | ...!cs.utexas.edu!ibmchs!auschs!doorstop.austin.ibm.com!tif

alan@ukpoit.co.uk (Alan Barclay) (06/25/91)

In article <8717@awdprime.UUCP> tif@doorstop.austin.ibm.com (Paul Chamberlain) writes:
>In article <1991Jun21.153058.17535@ukpoit.co.uk> alan@ukpoit.co.uk (Alan Barclay) writes:
>>Just in case anyone is interested, I backed it to K&R without very much
>>effort, the only major problem was with the variable arguments stuff
>>and even that was only a hour or so's work.
>
>And I bet you've got a gazillion requests already, how about posting
>the diffs somewhere?
>

I will do, as soon as I'm sure I've got the variable argument stuff 
correct.
(Ps. My mailbox is empty....)
-- 
  Alan Barclay
  iT                                |        E-mail : alan@ukpoit.uucp
  Barker Lane                       |        BANG-STYLE : .....!ukc!ukpoit!alan
  CHESTERFIELD S40 1DY              |        VOICE : +44 246 214241