Thank you very much in advance for helping!
I have this code in bash:
for d in this_folder/*
do
plugin=$(basename $d)
echo $plugin'?'
read $plugin
done
Which works like a charm. For every folders inside ‘this_folder’, echo it as a question and store the input into a variable with the same name.
But now I’d like to exclude some folders, so for example, it will ask for every folder in that directory, ONLY if they are NOT any of the following folders: global, plugins, and css.
Any ideas how can I achieve this?
Thanks!
UPDATE:
This is how the final code looks like:
base="coordfinder|editor_and_options|global|gyro|movecamera|orientation|sa"
> vt_conf.sh
echo "# ========== Base" >> vt_conf.sh
for d in $orig_include/@($base)
do
plugin=$(basename $d)
echo "$plugin=y" >> vt_conf.sh
done
echo '' >> vt_conf.sh
echo "# ========== Optional" >> vt_conf.sh
for d in $orig_include/!($base)
do
plugin=$(basename $d)
echo "$plugin=n" >> vt_conf.sh
done
If you have a recent version of bash, you can use extended globs (
shopt -s extglob):