View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
1 2 Different types of shell Shell Path Description OS Bourne /bin/sh This is the original Unix shell written by Steve Bourne of Bell Labs. It is available on all UNIX systems. All unix Korn /bin/ksh This shell was written by David Korn of Bell labs. It is now provided as the standard shell on Unix systems. AIX C /bin/csh This shell was written at the University of California, Berkeley. It provides a C-like language with which to write shell script. BSD TC /bin/tcsh This shell is available in the public domain. It provides all the features of the C shell together with emacs style editing of the command line. MAC OSX Bash /bin/bash This is a public domain shell written by the Free Software Foundation under their GNU initiative. Ubuntu, Centos Reference: http://unixhelp.ed.ac.uk/shell/oview2.html
1 2 Summary of shell features Bourne C TC Korn Bash Command history no yes yes yes yes Command alias no yes yes yes yes Shell scripts yes yes yes yes yes Filename completion no yes* yes yes* yes Command line editing no no yes yes* yes Job control no yes yes yes yes * Not the default setting for this shell. Reference: http://unixhelp.ed.ac.uk/shell/oview1.1.html
1 2 Configuration files for shells sh ksh csh tcsh bash /etc/.login login login /etc/csh.cshrc yes yes /etc/csh.login login login ~/.tcshrc yes ~/.cshrc yes yes ~/.login login login ~/.logout login login /etc/profile login login login ~/.profile login login login ~/.bash_profile login ~/.bash_login login ~/.bash_logout login ~/.bashrc int. + n/login blank means a file is not read by a shell at all. "yes" means a file is always read by a shell upon startup. "login" means a file is read if the shell is a login shell. "n/login" means a file is read if the shell is not a login shell. "int." means a file is read if the shell is interactive. Reference: http://en.wikipedia.org/wiki/Unix_shell
1 2 Redirect descriptor Descriptor Description 0 Standard Input (Generally Keyboard) 1 Standard output (Generally Display/Screen) 2 Standard Error Ouput (Generally Display/Screen) > Redirect standard output 2> Redirect standard error 2>&1 Redirect standard error to standard output < Redirect standard input from >> Append to standard output & Run as background process
1 2 Redirect usage Let me write the example about how to use redirection in various purpose. Redirect standard output to a file #!/bin/bash /home/panu/start-application1.sh > file Append standard output to a file #!/bin/bash /home/panu/start-application1.sh >> file Redirect standard input from file #!/bin/bash /home/panu/start-application1.sh < file Redirect standard output to “std_out.log” and redirect standard error to “std_error.log” #!/bin/bash /home/panu/start-application1.sh > std_out.log 2> std_err.log Redirect standard error to standard output “std_out_err.log” #!/bin/bash /home/panu/start-application1.sh > std_out_err.log 2>&1
Thank you for watching my presentation Created by panuausavasereelert blog: http://panu.in.th email: email@example.com twitter: @panuinth