Посмотрите на 4 arranger и 5 line!
#!/bin/bash
foldername='New Folder'
number=1
number=$((number+1))
cd "$foldername$number"
echo '$number' > number.txt
Опция --trust-server-names
должна это делать.
--trust-server-names
If this is set to on, on a redirect the last component of the redirection URL will be used as the local file name. By default it is used the last component in the original URL.