Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

First Shell Script

Name: Anonymous 2009-09-21 19:23

#!/bin/sh
if [ $1 -lt 0 ]
then echo "$1 is a negative number"
elif [ $1 -eq 0 ]
  then echo "$1 is number zero"
  else echo "$1 is a positive number"
fi

Name: Anonymous 2009-09-21 21:30

$ fag()
if [ $1 -lt 0 ]
then echo "$1 is a negative number"
elif [ $1 -eq 0 ]
  then echo "$1 is number zero"
  else echo "$1 is a positive number"
fi
$ fag a
-bash: [: a: integer expression expected
-bash: [: a: integer expression expected
a is a positive number

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List