#!/bin/sh
if test -n $1
then
echo "Some input entered"
echo $1
else
echo "no input entered"
fi
The above code is supposed to say "no input entered" if I dont pass an argument to the shell script. the echo $1 shows a blank line when I dont pass any arguments. its saying "some input entered" even without any arguments.
#!/bin/bash? And finally, if you're using bash, forgettestand start usingif [[ cond ]] ; thenform of syntax. Good luck.