I too just saw this, & echo the 2 compliments.
I do think your script could be way simpler, or else I don't understand what you are trying to do. Assuming your "list of shares in the following table format" is in a file (SHARES) & the command that will mount a share is
smbmount //server/share /mnt/server/share -o guest where "share" is the current share, then would this not work:
Code:
#!/bin/bash
# set the share table file
SHARES=<share_table_file>
for S in `awk '{print $1}' $SHARES`
do
smbmount //server/$S /mnt/server/$S -o guest
done