Problem with scripts in ksh

ACP Network acp at ms.uky.edu
Wed Jan 10 06:27:46 AEST 1990


I hesitate to call this a bug right away, but ksh on two of our machines
seems to have trouble executing scripts.  I've tested this on a vax
running ultrix (3.1?) and a sequent running dynix, with the same
results.

Any script that starts out with
#!/bin/ksh
executes fine as long as the statements are internal to ksh (eg, echo,
if/then/fi, etc) but hangs after executing the first external command
(I've tested it with ps, cat, grep, and sed).  For instance, a script such as

#!/bin/ksh
ps -a
echo 'done.'

executes the ps -a then hangs with no message.  ^C will break out of it, 
but the second echo never executes.  Any statements internal to ksh placed 
before the ps line will execute normally.

Taking out the #!/bin/ksh line makes the script work properly (my default
shell is ksh anyway).  Changing it to #!/bin/sh or #!/bin/csh makes
the script work properly (if the internal commands are compatible with
the new shell, of course).  It also runs properly on a machine running
SYSV/386 3.2.

Is this some obscure feature I don't know about? :-)

Kenneth Herron
-- 
acp at ms.uky.edu        University of Kentucky         ACP Network Consultant
ukma!acp         Dept. of Mathematics, room 715 POT          (606) 257-2975
                       Lexington, KY 40506



More information about the Comp.unix.questions mailing list