There is program I use, say xyz
, that has undesirable effects if I run the command bare with no arguments. So I'd like to prevent myself from accidentally running the xyz
command with no arguments but allow it to run with arguments.
How can I write a shell script so that when calling xyz
with no arguments it will print an error message and otherwise pass any and all arguments to the xyz
program?