i wanted to check my args wheather is a empty string or -P when i run my code but it prompt an error msg. The error msg say i have an unary operation expected at line 3 and 7.
m i doing a wrong way to check for empty argument? if i wanted to check for empty argument how m i going to do it?

if test $1 == "-P" then
read -p "Enter username: " username
elif test $1 == " " then
echo "Args Requires"
fi

Perhaps if [ "$1" == "" ];

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.