views:

21

answers:

1
DISPLAY_HEADER=1
 if [ "$1" != "test" -o "$1" != "test2" ]
    then
        if [ $DISPLAY_HEADER == 1 ]; then
                DISPLAY_HEADER=0
                echo "sdasa "
                echo $1
        fi
   fi

its display sdasa and -o is not working ?

what is wrong ?

+2  A: 

you can use case/esac

case "$1" in
  test|test2) 
    # do something
  *) 
    # set display data 
    ;;
esac
ghostdog74