Getting Started (Chap 5)
Assignment 4
- Create a script file called nf that contains
instructions to count the number of files in the current directory.
You can check your answers here.
- What command do you use to make this file executable?
- What directory should you put the file in?
- Add a comment at the begining of the file with your name and the date
- Add some text to the output to describe the number. i.e. "Files in the current directory:"
- Modify the script so that it includes the absolute pathname of the directory.
This is stored in the variable called PWD.
- Store your first name in a variable and then display it with a meaningful message.
- Add a comment on the same line as you set the variable.
- At the command prompt or in a script file, create two variables with numbers stored in them.
Calculate the product (multiplication) of these and display it.
- Assign the value of this product to another variable then display that new variable.