next up previous contents
Next: Processes Up: SYSTEMS PROGRAMMING LABORATORY III Previous: SYSTEMS PROGRAMMING LABORATORY III   Contents

Examples&Exercises:

  1. Study scripts; http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/firstfirst, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/variscriptvariscript, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/ginfoginfo, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/sayHsayH, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/demodemo, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/showfileshowfile, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/ispositiveispositive, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/isnumpnisnumpn, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/nestedifnestedif, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/elfelf, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/testfortestfor, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/mtablemtable, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/testfor2testfor2, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/nestedfornestedfor, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/chessboardchessboard, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/nt1nt1, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/carcar, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/dsh1dsh1, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/userinteuserinte, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/menuuimenuui, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/dialdial, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/dial2dial2, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/dial3dial3, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/dial4dial4, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/smenusmenu, http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/aniani.
  2. How to write shell script that will add two numbers, which are supplied as command line argument, and if this two numbers are not given show error and its usage
  3. Write Script to find out biggest number from given three numbers. numbers are supplied as command line argument. Print error if sufficient arguments are not supplied.
  4. How to calculate 5.12 + 2.5 real number calculation at prompt in Shell ? Answer: Use command as , echo 5.12 + 2.5 $ \vert$ bc , here we are giving echo commands output to bc to calculate the 5.12 + 2.5.
  5. How to perform real number calculation in shell script and store result to third variable , lets say a=5.66, b=8.67, c=a+b?
  6. Write script to print numbers as 5,4,3,2,1 using while loop.
  7. Write script to determine whether given file exist or not, file name is supplied as command line argument, also check for sufficient number of command line argument
  8. Write shell script to show various system configuration like
    1. Currently logged user and his logname
    2. Your current shell
    3. Your home directory
    4. Your operating system type
    5. Your current path setting
    6. Your current working directory
    7. Show Currently logged number of users
    8. About your os and version ,release number , kernel version
    9. Show all available shells
    10. Show mouse settings
    11. Show computer cpu information like processor type, speed etc
    12. Show memory information
    13. Show hard disk information like size of hard-disk, cache memory, model etc
    14. File system (Mounted)
    Implement as many as possible.
  9. Write script to implement getopts statement, your script should understand following command line argument called this script
    script -c -d -m -e
    Where options work as
    -c clear the screen
    -d show list of files in current working directory
    -m start mc (midnight commander shell) , if installed
    -e { editor } start this { editor } if installed
    

next up previous contents
Next: Processes Up: SYSTEMS PROGRAMMING LABORATORY III Previous: SYSTEMS PROGRAMMING LABORATORY III   Contents
Cem Ozdogan 2007-05-16