I have a script that organizes files in my downloads directory according to their filetype.
function moveto {
for filename in *
do
case "${filename##*.}" in
$1 ) echo "!";; # echo statement for debugging
esac
done
}
I have a .png file in my downloads directory and nothing else.
When I call moveto "png"
, the exclamation mark appears.
When I call moveto "png|jpg"
, the exclamation mark doesn't appear.
When I simply type png|jpg
into the case statement, using no variables, the exclamation mark appears.
I've tried changing things up more than a few ways; using single quotes, double quotes, no quotes, aliases, etc., nothing seems to work. Would be great if someone could help out.