Certainly basic doubt about IF

On the below "IF" i test if the user have put the first argument.
I also would like to test if the user have written a second argument.
So, my doubt is:
- How can i evaluate 2 conditions on a if statement? How is the OR created?
- How can i to verify if the second argument is non empty?

Thanks in advance :slight_smile:

### Evaluate the correct input arguments
if ( $1 == "" ) then
echo; echo "Usage: buildVOCandWORDLIST <corpus_file>"
echo "Input Arguments: <corpus_file> -> corpus"
echo "Output Arguments: <corpus_file.vocab> -> vocabulary"
echo " <corpus_file.wordlist> -> wordlist"
echo " <corpus_file.vocab.stat>-> statistics of vocabulary"
echo; exit
endif

if [[ "x$1" == "x" ]] ; then
echo "No arguments provided"
elif [[ "x$2" == "x" ]] ; then
echo "Only 1 argument. No second argument."
else
echo "Arguments are "$@""
fi ;
if [ -z "$2" ] ; then
echo "No second argument."
fi ;

There is yet another construct which gives you the number of arguments provided to the script.

$#

Read the man pages of sh and ksh

vino