On Mon, 08 May 2000, you wrote:
> On Fri, 9 Jul 1999, Yants wrote:
> 
> > how do i write shell scripts..?
> > can someone please show me an example...
> > 
Here's an example from Richard Petersen's handy
Linux Programmer's Reference: (Good book to have around)

#!/bin/bash
#Program to allow the user to select different
#ways of listing files
 
echo s. List Sizes
echo l. List All file info
echo c. List C files
echo -n "Please enter choice: "
read choice
case $choice in
   s)
       ls -s
       ;;
    l)
       ls -l
       ;;
    c)
        ls *.c
        ;;
   *)
      echo Invalid Option
esac
 
copy it, save it as, for example, lschoice, and chmod u+x so that you can
execute it by typing ./lschoice

HTH
Irv Mullins          

Reply via email to