delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/08/07:11:26

Date: Sun, 8 Mar 1998 14:10:33 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Jeff T. Williams" <jeffw AT darwin DOT sfbr DOT org>
cc: djgpp AT delorie DOT com, jeffw AT darwin DOT sfbr DOT org
Subject: Re: true and false in bash scripts
In-Reply-To: <199803061449.IAA07772@kendall.>
Message-ID: <Pine.SUN.3.91.980308141011.22686Z-100000@is>
MIME-Version: 1.0

On Fri, 6 Mar 1998, Jeff T. Williams wrote:

> #!/djgpp/bin/bash

This is unnecessary: you can type the usual "#!/bin/sh" and it still
will work (provided you have sh.exe which is a ``symlink'' to
bash.exe).  The DJGPP port of Bash will look for `sh' along the PATH
if it is not found in `\bin', and you gain portability in your
scripts.

> if true ; then
> echo True
> else
> echo False
> fi
> 
> I get the following error:
> 
> Exiting due to signal SIGSEGV
> Page fault at eip=0000a1ba, error=0004

`true' and `false' are not built-in commands in Bash, they are
external commands.  You need to install Sh-utils (v2gnu/shl112b.zip)
to have them.  Or just type this from the DOS prompt:

	cat > \djgpp\bin\true
	#!/bin/sh

	usage="Usage: $0 [OPTION...]

	   --help      display this help and exit
	   --version   output version information and exit"

	case $# in
	1 )
	  case "z${1}" in
	    z--help )
	       echo "$usage"; exit 0 ;;
	    z--version )
	       echo "true - GNU sh-utils 1.12"; exit 0 ;;
	    * ) ;;
	  esac
	  ;;
	 * ) ;;
	esac

	exit 0
	^Z

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019