Basic Shell script question

absolsp_at_yahoo.com
Date: 03/24/05


Date: 23 Mar 2005 23:15:37 -0800

I have Solaris 9 installed and using a simple shell script.

#!/bin/sh

echo "Begin"
cd /nonexistent/directory
echo "end"

The second echo does not print, the cd command fails and quits the
script. Is this normal behaviour for shell scripts. I ran the script
in Red Hat 9.0 and it worked fine, the cd command printed an error and
the echo command also got executed.

Is this a bug in Solaris shell or a documented behaviour.

thx,
Ab



Relevant Pages

  • SHELL Scripts
    ... Not sure where to post this...but I am having some trouble with a Shell Script. ... I am getting an error when I use the CALL command in the shell script. ... echo of the text inputed. ... GOTO EOF ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... > This works fine from the command line. ... > a shell script, i get: ...
    (comp.lang.awk)
  • Re: Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... > This works fine from the command line. ... > a shell script, i get: ...
    (comp.unix.shell)
  • Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... This works fine from the command line. ... a shell script, i get: ...
    (comp.lang.awk)
  • Re: Machine data
    ... I'm looking for a shell script to show these informations: ... (I need this to Red Hat, Solaris and Tru64). ... Find out what command to get those info, ...
    (comp.unix.shell)