[ale] Shell scripting with bash
Glenn C. Lasher Jr.
glasher at nycap.rr.com
Thu Apr 19 06:43:54 EDT 2001
Use a loop, like this:
kernel=""
while ! [ -e $kenel ]
do
echo -n "Enter kernel to include: "
read kernel
done
cp . . .
lilo . . .
exit . . .
On Wed, 18 Apr 2001, Ken Nagorski wrote:
> Hi there,
>
> I have a little problem using bash. I usually use bash for real
> simple stuff no more than 3-4 lines of code however I have a script that
> lends itself to bash. It's for making boot disks that use lilo. It works
> fine except for the part where I call a function.
>
> The code is below however, this is what I wanna do. I want to set
> it up so that the user enters the kernel they want on the boot disk. If
> that doesn't exsist - ask agian. I seem to be having a bit of a problem
> making use of functions in bash....
>
> get_kern
> {
> echo "Please enter the full path of the kernel you wish to use"
> read kernel
> }
>
> if [ -e $kernel ]
> then
> cp $kernel /mnt/floppy/vmlinuz
> lilo -v -C /mnt/floppy/lilo.conf -f /mnt/floppy
> exit 0
> else
> get_kern
> fi
>
>
> It works the first time I call it from the program but then it
> complains if I try to call it agian. Any suggestions. I looked at the bash
> programing howto and I couldn't find anything about calling functios cept
> the simple little example. I also checked the web. Nothing helped there
> either.
>
> Thank you
> Ken
>
>
>
> --
> I couldn't quite remember what I was going to say
> so I causally tip another sip of whatever it was I was drinking,
>
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
>
--
glasher at nycap.rr.com
After 163 days, Verizon still couln't deliver Telocity DSL.
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list