r/bashscripts • • Oct 31 '20

Bash scripting in Linux

0 Upvotes

Hi there, I need help doing the following bash scripting in Linux:

1- Implement the print_usage function, which will print out the following message: Usage: myuseradd.sh -a <login> <passwd> <shell> - add a user account myuseradd.sh -d <login> - remove a user account myuseradd.sh -h - display this usage message

2- Implement the parse_command_options function which should: Parse the command arguments and call the appropriate function -h should call print_usage -d should call delete_user -a should call add_user If an invalid argument is given, such as -z, print out an error message and the usage information in the print_usage function. ERROR: Invalid option: -z