bash - Unix How to check if a specific word is entered in as an argument -
i'm writing script in unix need way check argument entered in command line specific word.
so if when using script user types:
$ ./script hello
my script can tell "hello" entered argument , can display message appropriately.
and if user types other "hello" argument script can display message.
thanks.
this should work:
#!/bin/bash if [[ $1 == hello ]];then echo "hello entered" else echo "hello wasn't entered" fi
Comments
Post a Comment