Is there a more efficient way to run this? I am especially interested in a way which perhaps does not require a for
loop...
shopt -s nullglob
file=
declare -a ARRAY1
ARRAY1=( ~lettus_*.sh )
for file in ${ARRAY1[@]}
do
##
## Get <name> from /some/path/lettus_name.sh
##
# remove .sh extension
file=${file%.sh}
# remove full path up to and including lettus_
file=${file//*lettus_}
echo $file
done
shopt -u nullglob