Exercises: Shell scripts

Exercise 1:

You can now control the number of times a for loop iterates by including a number as an argument when you call it. Write a script which will create as many numbered directories as you want when you run it.

Exercise 2:

  1. Create a bash script called hi which will use the USER environment variable to say hello to you

  2. Make this script executable

  3. Create a /scripts directory in your home directory

  4. Add this directory to the PATH environment variable

  5. Move the new script there and try running it as a command