Getting started with shell
Remarks#
This section provides an overview of what shell is, and why a developer might want to use it.
It should also mention any large subjects within shell, and link out to the related topics. Since the Documentation for shell is new, you may need to create initial versions of those related topics.
Installation or Setup
A command shell is a command line interface computer program to an operating system.
Some Variants
1. Bash : Comes as default shell on ubuntu
2. KornShell(ksh) :
To install ksh in Ubuntu
$ sudo apt-get install kshTo start working with ksh
$ ksh
$ ps $$
PID TTY STAT TIME COMMAND
4187 pts/2 S 0:00 kshEnter the commands at the ksh prompt
3. csh :
To install csh in Ubuntu
$ sudo apt-get install csh
To work with csh, go to the command line and enter csh
$ csh
%Hello World
At the command prompt:
$ echo "Hello World"Output:
Hello WorldTo create a script, create a text document with the following content:
#!/bin/sh
echo "Hello World"Save the script with the name hello.sh (or any filename) and make the script executable by giving the following permission:
$ chmod 755 hello.shOr:
$ chmod +x hello.shRun the script:
$ ./hello.shOutput:
Hello WorldTo run a local shell script without executable permission:
1.bash
$ bash hello.sh
Hello World2.ksh
$ ksh hello.sh
Hello World3.sh
$ sh hello.sh
Hello World