[ale] Shell scripting with bash

James Kinney jkinney at localnetsolutions.com
Wed Apr 18 22:27:04 EDT 2001


I think you need a looping control structure. As it is, it looks like it
either cp's a kernel image or asks for one. Not both. Add a
running=1
while [ $running ]; do

	if [ -e $kernel ]
	then ...
	running=0
	else...
done


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.
>

-- 
James P. Kinney III   \Changing the mobile computing world/
President and COO      \          one Linux user         /
Local Net Solutions,LLC \           at a time.          /
770-493-8244             \.___________________________./

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list