Is there a way to make a bash script require a set of parameters when it's loaded, and if not, it will automatically spit out an echo
to the screen giving instructions?
Looking at this example of a script called copy
user@localhost : user # ./copy
Copy by SamplePerson
Usage:
copy [path/to/file] [path/to/destination]
user@localhost : user #
I want it to make sure that if no parameters are given, it will automatically just spit out some predefined text on the echo
.
I know how to ensure that the user enters correct values, but I just want the initial "usage" information be displayed for them.