Bash shell scripting, simple Sorting of files by files type, using $@ or $*


cd ... || exit

side note I'd also appreiciate it if anyone knows how would you modify the code to accept as another command line argument a URL and have your script download the zip file from the internet. So it isnt limited to downloading from one place pre-programmed.

wget --user=mbella200 --password=INSERTPASSWORD \
"" \
unzip xid-2989828_2 rm xid-2989828_2

read -r "$@" mkdir "$@"

I tried to use as little lines of code as possible, but cant figure out how to use $@ or $* here to create a folder containing all files of that type. The only way I could make it work was to write 9 if statements using $1, $2 etc.. but that isnt ideal as I want it to be able to accept a lot more than 9 arguements.

if [ -d "$" ]; then mv ~/unsorted_files/*"$*" "$*" fi

mkdir miscellaneous mv ~/unsorted_files/* ~/miscellaneous/ rm -r ~/unsorted_files

currently this script will take create all the folders that u specify in the command line argument then proceed to ignore the if statement? and throw every file in the misc folder at the end.