I am quite new to bash scripting but I managed to write a script that works almost perfectly and I am really proud of myself. However, I have this problem which I dont get why it would not work. Part of my current code is this:
for begin in 1 51
do
echo -e "$begin"
url="http://something&start-index=$begin&something"
wget -O $HOME/Music/YoutubePlaylist/output$begin.txt $url 2>&1
cat output1.txt > output.txt
if ! [[ "$begin" = 1 ]]
then
cat output$begin.txt >> output.txt
fi
done
It works perfectly.
However, if I add 101 to the first line, it wont work. Any idea why? What it actually does when I look at my temp files, is only write what is in output1.txt in output.txt and nothing else.
PS: output1.txt and output51.txt are not empty whereas output101.txt is empty. Maybe thats an hint....
wgetting the URL manually for your "101" case?