Skip to content

Instantly share code, notes, and snippets.

@pirogoeth pirogoeth/global.sh
Created Jan 12, 2011

Embed
What would you like to do?
generates a global.tcl file to load eggtcl scripts simply.
#!/usr/bin/env bash
#global.tcl generator
# variables
select_list="Yes No"
if test -e ./global.tcl ; then
echo "Remove global.tcl?"
select choice in $select_list
do
case $choice in
Yes)
rm ./global.tcl
break
;;
No)
break
;;
esac
done
fi
for item in $(ls)
do
if test -d $item ; then
directories="$directories $item"
fi
done
for directory in $directories
do
directory_items=$(ls $directory/*.tcl)
for item in $directory_items
do
echo "Enable $item?"
select choice in $select_list
do
case choice in
Yes)
echo "source scripts/egg/$directory/$item"
break
;;
No)
break
;;
esac
break
done
done
done
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.