IRIX/linux csh differences

IRIX/linux csh differences

Post by Joe Mildenberge » Fri, 07 Feb 2003 03:05:50



I have a csh script that requests user input that is usually entered
interactively, but can also be run from a little file of "stock answers" if I
choose to to redirect the standard input to that file. This script has worked
reliably in this mode under IRIX, but fails under linux. Where it fails is when
the input requests are coming from a sub-script (also csh) that runs from within
the main script: for some reason, and only under linux, the sub-script does not
want to read the "stock answers" from the input file, i.e. it looks like the
sub-script does not know where it is supposed to get its standard input from. Is
this a "known feature" of the linux csh, and is there some way to get around this?

                            Thanks in advance,
                                 Joe

 
 
 

IRIX/linux csh differences

Post by Richard T. K » Fri, 07 Feb 2003 05:42:34




Quote:>I have a csh script that requests user input that is usually entered
>interactively, but can also be run from a little file of "stock answers" if I
>choose to to redirect the standard input to that file. This script has worked
>reliably in this mode under IRIX, but fails under linux. Where it fails is when
>the input requests are coming from a sub-script (also csh) that runs from within
>the main script: for some reason, and only under linux, the sub-script does not
>want to read the "stock answers" from the input file, i.e. it looks like the
>sub-script does not know where it is supposed to get its standard input from. Is
>this a "known feature" of the linux csh, and is there some way to get around this?

>                            Thanks in advance,
>                                 Joe

 First thing linux csh is really tcsh and not the old csh.

 richk

 
 
 

IRIX/linux csh differences

Post by Bill Marcu » Sat, 08 Feb 2003 00:24:29


On Wed, 05 Feb 2003 10:05:50 -0800, Joe Mildenberger

> I have a csh script that requests user input that is usually entered
> interactively, but can also be run from a little file of "stock answers" if I
> choose to to redirect the standard input to that file. This script has worked
> reliably in this mode under IRIX, but fails under linux. Where it
fails is when
> the input requests are coming from a sub-script (also csh) that runs

from within
 > the main script: for some reason, and only under linux, the
sub-script does not
Quote:> want to read the "stock answers" from the input file, i.e. it looks like the

 > sub-script does not know where it is supposed to get its standard
input from. Is
 > this a "known feature" of the linux csh, and is there some way to get
around this?
The linux csh is really tcsh.  I don't know enough about (t)csh to solve
your problem, but csh is not the best shell for writing scripts.
Perhaps you should consider writing your script in bash.
 
 
 

IRIX/linux csh differences

Post by Tim Cargi » Sat, 08 Feb 2003 01:23:15


Problem #1

Quote:> >This script has worked reliably [ ... ]

Contradiction in terms (csh and reliability)

[ ... ]

Quote:> >Is this a "known feature" of the linux csh,

Unreliability is a 'known feature' of all cshs ...

And unportability.

and is there some way to get around this?

  /bin/sh, /bin/ksh, /bin/zsh

Check this:  http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

... or ... make sure the 'stock input' file was copied to
Linux and is in the correct place.  Maybe ... maybe! ...
it's not actually a '[t]csh' problem.

Quote:

>                             Thanks in advance,
>                                  Joe

Da Nada,

Tim

 
 
 

IRIX/linux csh differences

Post by Heiner Marx » Sat, 08 Feb 2003 02:18:17




Quote:>I have a csh script that requests user input that is usually entered
>interactively, but can also be run from a little file of "stock answers" if I
>choose to to redirect the standard input to that file. This script has worked
>reliably in this mode under IRIX, but fails under linux. Where it fails is when
>the input requests are coming from a sub-script (also csh) that runs from within
>the main script: for some reason, and only under linux, the sub-script does not
>want to read the "stock answers" from the input file, i.e. it looks like the
>sub-script does not know where it is supposed to get its standard input from. Is
>this a "known feature" of the linux csh, and is there some way to get around this?

Assuming "csh" really is "tcsh", from the man page of tcsh:

       $<      Substitutes a line from the standard  input,  with
               no  further  interpretation thereafter.  It can be
               used to read from the keyboard in a shell  script.
               (+)  While  csh  always  quotes  $<, as if it were
               equivalent to `$<:q', tcsh does not.

Still, your script may contain some subtly nonportable parts, or it may
trigger some tcsh extension not present in csh and thus not expected.

--

 
 
 

1. test command differences between IRIX and Linux

I've been living fat dumb and happy, using Bourne Shell, and under
IRIX  for the past 10 years or so.

Now, I'm having to migrate shell scripts to Fedora Linux, and have run
into a problem.

In several places I have used the test command to test for readable
file existence in a directory, and if  readable files are there,
continue processing, else stop, reporting the empty directory  to the
operator.

sample code:
[ -r [1-9]* ] || echo "No files in the upload directory"
[ -r * ] || echo "No files in transfer directory"
[ -r [1-9]* ] && cp [1-9]* /$ARTICLES

Under IRIX, this works properly.  Under Bash/Linux coreutils test
command, it bombs out with completely unwanted extra help, without
providing a result.

How would I test one or more readable files in a directory under Bash,
using the standard test operator.  I can work with having to backslash
the internal brackets, but not the extra crap from a command that is
supposed to return a boolean result.

Right now, I'm a little too pissed off to see the simple solution, or
workaround to how I think the world should be.  Naturally, this is
crunch time.

Jim

2. Masquerading; Spme do and some don't

3. Mounting Irix 5.3 cd on non-irix (linux) system?

4. Ethernet IRQ conflict - I'm stuck

5. Differences between Solaris 2.5 and current version and IRIX

6. Solaris 2.3 and POSTSCRIPT printers......

7. Red Hat Nullifies Differences Between bash, csh

8. driver problem

9. csh / tcsh differences ... problem

10. Help with redirect ( >> ) differences between csh and bsh

11. what's difference between bash and csh?

12. csh and ksh symbolic link differences

13. Follow Up: Irix 6.2 Hangs On Console Login ("amd" on Irix 6.2)