csh question

Ivan Warner,G44 SSTF,6632, iwarner at zaphod.axion.bt.co.uk
Wed May 24 19:36:26 AEST 1989


>From article <19712 at adm.BRL.MIL>, by nodak.edu>@adm.BRL.MIL:
> 
>   A friend of mine was playing with our version of the csh on a (mostly)
> Sys V.2 lookalike system, when the following sequence occured:
> 
> % set ab = (spi kev ish ere)
> % echo $ab[1]
> spi
> % alias test ' foreach x (1 2 3) \
> echo $ab[$x] \
> end '
> % test
> ? ?
> DISCONNECTED from 04/118
> 
> Are we doing something incredibly stupid here ?  Or do we have a brain damaged
> version of csh ?  We're running sx1100 2R1 on an sperry 1100/91 mainframe with
> a binary only license.
> 

	If its any consolation, the Ultrix V3.0 version of csh did 
the same - it output "? ?", and then logged me out.

	Run from within a shell script, it does not log me out, but it
doesn't do what it should.


	Running the shell script:

                set ab = (spi kev ish ere)
                echo $ab[1]
                alias test ' foreach x (1 2 3) \
                echo $ab[$x] \
                end '
                alias test
                echo '--------------------------'
                sleep 5
                test

        using the command "csh -x cshtest" gives the output:

                set ab = ( spi kev ish ere )
                echo spi
                spi
                alias test  foreach x (1 2 3)
                echo $ab[$x]
                end
                alias test
                 foreach x (1 2 3)
                echo $ab[$x]
                end
                echo --------------------------
                --------------------------
                sleep 5
                foreach x ( 1 2 3 )

	i.e. the script dies at the "foreach" command, but with no error
message.

	Must be a bug in csh.



More information about the Comp.unix.questions mailing list