SHELL PROGRAMMING
When a group of commands has to be executed regularly, they should be stored in a file,
and the file itself executed as a shell script or shell program. Though it’s not mandatory,
we normally use .sh extension for shell scripts.
A shell program runs in interpretive mode. It is not compiled into a separate executable file as a C program is. Each statement is loaded into memory when it is to be executed.
Installing any Ubuntu/Linux package using the command:
sudo apt-get install [package_name]
Ex:
To install gedit editor
>-sudo apt-get install gedit
Creating a file in gedit editor
>-sudo gedit [file_name]
Ex:
>- sudo gedit shell_program_1.sh
Few Examples Of Shell Codes:
1
............................................................................................................
shell_program_1.sh
............................................................................................................
............................................................................................................
For Execute Type:
>-sh shell_program_1.sh
in the Terminal.
2
............................................................................................................
shell_program_2.sh
............................................................................................................
............................................................................................................
Execute: sh shell_program_2.sh
............................................................................................................
thanks
ReplyDelete