background preloader

Shell Script

Facebook Twitter

Introduction à la programmation en Bash. Guide avancé d'écriture des scripts Bash. Bash commands - Linux MAN Pages. LSST v1.05 > Chapter 8 > Examples of Shell Scripts. These exercises are to test your general understanding of the shell scripting. My advise is first try to write this shell script yourself so that you understand how to put the concepts to work in real life scripts. For sample answer to exercise you can refer the shell script file supplied with this tutorial. If you want to become the good programmer then your first habit must be to see the good code/samples of programming language then practice lot and finally implement the your own code (and become the good programmer!!!).

Q.1. How to write shell script that will add two nos, which are supplied as command line argument, and if this two nos are not given show error and its usage Answer: See Q1 shell Script . Q.2.Write Script to find out biggest number from given three nos. Q.3.Write script to print nos as 5,4,3,2,1 using while loop. Q.4. Q.5.Write Script to see current date, time, username, and current directory Answer: See Q5 shell Script. Q.13. Q.14. Q.15. Q.16. Q.17. Q.18. Q.19.