[SunHELP] Sun Script
vishal at netsolutionsindia.net
Wed Apr 28 15:07:19 CDT 2004
Thank you for the reply, this is how i modify the script but it gives me
error message :
shell: line 17: syntax error near unexpected token `'o')'
shell: line 17: `'o')'
Any Comments ?
echo -n "Enter d [to List files], o <name> [check the file], s <name> [make
the directory] or 6 to quit:"
case $input in
echo "Invalid Command you jerk!"
----- Original Message -----
From: "Dale Ghent" <daleg at elemental.org>
To: "Vishal" <vishal at netsolutionsindia.net>; "The SunHELP List"
<sunhelp at sunhelp.org>
Sent: Thursday, April 29, 2004 1:14 AM
Subject: Re: [SunHELP] Sun Script
> On Apr 28, 2004, at 2:49 PM, Vishal wrote:
> > Hello All,
> > I would like to have the follwing script :
> > Write a UNIX shell script that will prompt the user with information to
> > enter the
> > Letter "d", "o" or "s" to execute the command as follows:
> > d - to list the contents of directory in long format.
> > o - <name> to check if a file <name> is in the current directory and
> > displays if it is present or not
> > s - <name> to make a new directory called <name> and change to a the
> > new
> > directory <name>
> > If an input other than "d", "o" or "s" is provided, display the
> > message "no!
> > try again". Put your code in a loop, so that the shell script is
> > terminated
> > by inputting the number 6.
> > if somebody can help me to write this.
> This is so simple. Specifically, you are looking for the read, case,
> while and for commands in Bourne shell (sh, bash)
> while $loop;
> echo -n "Enter your command or 6 to quit:"
> read input
> case $input in
> echo "Exiting..."
> unset $loop
> echo "Invalid Command you jerk!"
More information about the SunHELP