How can a Bourne Shell script know that the first parameter it received was '' (Two single quotation marks?
I’ve tried
if [ -z "$1" ] ; then
echo "Wrong number of parameters"
fi
But it seems that the $1 expands to an empty string and so is "$1".
When you type ” in command line shell translate it to argument – zero length string.
Check variable that holds the number or arguments (before checking -z “$1”).
See ‘man test’ for INTEGER comparison tests (-eq, -gt, etc).
EDIT (based on comments to question):
On windows (what shell do you use?) you have to check for ” (two characters) (cmd.exe passes it that way I think). On linux your script get an argument of string length zero.
if [ \( “$#” -gt 0 -a -z “$1” \) -o “$1” = “”” ]; …