#!/bin/bash
# Script to output the total size of requested filetype recursively
# Error out if no file types were provided
if [ $# -lt 1 ]
then
echo \"Syntax Err
If all you're trying to do is loop over the arguments, try something like this:
for type in "$@"; do
types="$types -o -name *.$type"
done
To get your code working though, try this:
#loop through additional filetypes and append
num=1
while [ $num -le $# ]
do
(( num++ ))
types=$types' -o -name *.'${!num}
done