I’m trying to clean up my shell script by placing repeating parameters in a bash variable.
The best approach I know is to put it in an array and pass it… but that doesn’t seem to work. How can I store all the parameters in a variable?
This doesn’t work:
TESTP=( "-path" ""./var/*"")
echo ${TESTP[@]}
# Results in: -path "./var/*"
find ${TESTP[@]}
# Returns no results.
While find -path "./var/*"
does return all files under var.