Featured Post

Monday, August 1, 2016

Different types of shells in UNIX



 A shell acts as an interface between application programs(or users)  and kernel.A shell provides an environment to run our commands shell script and programs. $ symbol indicates that you are in command mode and you can enter commands here.


/home/anil/~$ cat>ashok
hi this is shell demo
ctrl+d
/home/anil/~$

Following are different types of shells in unix:

Bourne shell : This is the default shell for many UNIX operating systems. Bourne shell was written by S.R Bourne.

 Default prompt is $

Executable file location /bin/sh

C shell:  C shell provides additional features like job control.


 Default prompt is %

Executable file location  /bin/csh

K shell:  K shell has features of both C shell and B shell

Default prompt is $

Executable file location /bin/ksh

Bash shell: Bourne again shell was developed by GNU project. It has features of both Bourne shell and C shell.

Default prompt is $

Executable file location  /bin/bash

                                              cjuschools.blogspot.in

tcsh shell:  It is the default shell of free BSD. It is an extension of C shell.

Default prompt is &

Executable file location /bin/tcsh

 why shell script?
    We can execute only one command or using pipe we can execute a limited set of related commands in command mode. We cannot execute a group of commands simultaneously in command mode. Shell script is a  program where we can place multiple commands at one place and execute all the commands at the same time.

sample shell program

echo "enter a file name"
read fname
if [ -f $fname ]
then
    echo "number of characters in the given file are `wc -c $fname`"
    echo "number of words in the given file are `wc -w $fname`"
    echo "number of  lines in the given file are `wc -l $fname`"
elif
  then
      echo "$fname is not a file"
done

output;

/home/anil/~$ sh count.sh
enter a file name
hello.txt
number of characters in a given file are 24
number of words in a given file are 6
number of lines in a given file are 2


                               system calls

 Shell program, shell script, positional parameters, different types of shells, default shell prompt, bourne shell,  chsell, bash shell , tcsh shell, kourne shell, zsh shell, positional parameters , UNIX architecture, UNIX kernel, Types f shell in UNIX and LINUX. executin shell program in LINUX.

No comments:

Post a Comment