Now all of it together, with no ready-made commands: your own script that runs by name from any directory.
You need a command called reports-count. It prints one number — how many files are in the ~/script-lab/old reports directory. Write the script in nano or vim, and test it from another directory, such as /tmp. The exercise check runs the command in a fresh login to the machine — as if you had just connected.
Make your own command
Make a command called reports-count: a script in ~/bin that prints one number — how many files are in the ~/script-lab/old reports directory. It must be found by name from any directory, including after a fresh login.
Goals · 0 of 3
- Write the reports-count script in ~/bin with a shebang on the first line not done yet
- Make the command found by name after a login not done yet
- Print the number of files in the directory with a space in its name not done yet