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 19:44

>>2
Okay, mage...


#!/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


Now writing to test for no arguments.

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