- I have done Shell Scripting in Linux.
- I have used VIM Editor for shell scripting.
- I have created one script of every task.
- Exercise 1 : I have to print a statement, So I used “echo” command for printing.
- Exercise 2 : I have to store a string in a variable then print that variable.
- Exercise 3 : I have to run a command “hostname” and the output of that command need to be stored in a variable then print it in the console.
- Exercise 4 : I have to print every word in the separate line using as small code as possible.
- Exercise 5 : I have to print a statement when exit status is 0, So I used command “echo $?”
- Exercise 6 : I have to create a function which will count the number of files in the present working directory.
sh Shell_Script_name.sh
Ex : sh Exercise1.sh