#!/bin/ksh
#clientlist
list=`ls -d client*`
i=1
for file in $list
do
if [ -d $list ]
then
echo \<option value="i"\> $list\</option\>
i=`expr $i + 1`
fi
done
Sorry for the delayed reply. I have added this into my index however made a slight change to the shell script so it didnt loop within itself;
#!/bin/sh
list=`ls -d /*`
i=1
for file in $list
do
if [ -d $file ]
then
echo \<option value="i"\> $file\</option\>
i=`expr $i + 1`
fi
done
However which ever way I do it the drop down menu just comes back blank.
Any ideas?
Thanks
---------- Post updated at 04:27 PM ---------- Previous update was at 02:17 PM ----------
Managed to get it working using;
for list in `ls -d /usr/local/apache2/htdocs/services/* | sed 's/\// /g' | awk {'print $6'}`;
do
if [ -d $file ];
then
echo '<option value="'/cgi-bin/$list.sh'">'$list'</option>'
fi
done