help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indent-tab-mode


From: Gary Wessle
Subject: Re: indent-tab-mode
Date: 02 Oct 2006 10:37:47 +1000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"s. keeling" <keeling@spots.ab.ca> writes:

> Gary Wessle <phddas@yahoo.com>:
> > 
> >  then how can I indent-while-typing this code
> >  #!/bin/sh
> >  #
> >  # if not vehicle name is given
> >  # i.e. -z $1 is defined and it is NULL
> >  #
> >  # if no command line arg
> > 
> >  if [ -z $1 ]
> >  then
> >  rental="*** Unknown vehicle ***"
> >  elif [ -n $1 ]
> >  then
> >  # otherwise make first arg as rental
> >  rental=$1
> >  fi
> > 
> >  case $rental in
> >  "car") echo "For $rental Rs.20 per k/m";;
> >  "van") echo "For $rental Rs.10 per k/m";;
> >  "jeep") ehco "For $rental Rs.5 per k/m";;
> 
> Typo:......^^^^

the expected results:




#!/bin/sh
#
# if not vehicle name is given
# i.e. -z $1 is defined and it is NULL
#
# if no command line arg

if [ -z $1 ]                    # first arg not given?
    then
    rental="*** Unknown vehicle ***"
elif [ -n $1 ]                  # first arg given
    then
# otherwise make first arg as rental
    rental=$1
fi

case $rental in
"car") echo "For $rental Rs.20 per k/m";;
"van") echo "For $rental Rs.10 per k/m";;
"jeep") echo "For $rental Rs.5 per k/m";;
"bicycle") echo "For $rental 20 paisa per k/m";;
    *) echo "Sorry, I can not get a $rental for you";;
esac


reply via email to

[Prev in Thread] Current Thread [Next in Thread]