Welcome to the Linux Foundation Forum!

Bash scripting

Ok, what I'm trying to do, and for the life of me I can't figure out is:

I'm asking, how many mount points one would like to use

need_input=1

while [ ! -z $c_loop ]; do

while [ -z "$Mountpoints" ]; do Mountpoints="$(user_in " >> How many mount points?: ")" ; done

if [ -z "$( echo $Mountpoints | grep "^[0-9]" )" ]; then

echo " - You must enter a numeric value"

unset Mountpoints

elif [ ! -z "$( echo $Mountpoints | grep "[a-zA-Z]" )" ]; then

echo " - Illegal Character, must be numeric value.. 1-9 10-20, etc?"

unset Mountpoints

else

unset need_input

fi

done

so if I said 5 mount points

The next loop, i'd like to ask 5 times, for each individual directory that it should mount to

if that makes sense?

would appreciate any help thanks - ajay

Nevermind -- I figured it out

loop=0

m_array=()

while [ $loop -le $Mountpoints ]; do

if [ $loop = $Mountpoints ]; then

echo "Completed!"

break

fi

loop=$(( $loop + 1 ))

# Ok, now we're needing to be adding remote mounts,

## I THINK ? lol, RTFM! RTFM! RTFM!

while [ -z ${m_array[loop]} ];

# loop=$(( $loop - 1 ))

do m_array[loop]="$(user_in " >> First mount point: ")" ;

done

echo ${m_array[*]}

done

Thanks though (in advance)

Categories

Upcoming Training