I have too many files urls in a txt file that i've downloaded using this bash command
awk '{url=$1; $1="";{sub(/ /,"");out=url" -O \""$0"\""}; print out}' file.txt | xargs -L 1 wget
this bash command above is supposed to get each file url and name and then rename them while downloading with the original name that is listed in front of each file url , the txt file containing those urls and their respective names is organized as follows:
http://example.com/1425233/47188.mp4 Abaixo de Zero (2021).mp4
http://example.com/1425233/47185.mp4 A Sentinela (2021).mp4
http://example.com/1425233/46849.mp4 Eu Me Importo (2021).mp4
http://example.com/1425233/47933.mp4 Loucura de Amor (2021).mp4
Well done, until this point everything is working correctly, the problem now is that when the download finishes, when i put the ls command in the terminal each file is presented with the title looking like this, all of them are looking like this:
'Abaixo de Zero (2021).mp4'$'\r'
'A Sentinela (2021).mp4'$'\r'
'Eu Me Importo (2021).mp4'$'\r'
'Loucura de Amor (2021).mp4'$'\r'
so this problem is causing the video not to play anymore, but when i rename manually to mp4 again then the '$'\r' string disappears and the video is able to play...
So having said that i want a linux command that can bulk rename all of the files and remove this '$'\r' string...
And then when listing in terminal the files would only be:
'Abaixo de Zero (2021).mp4'
'A Sentinela (2021).mp4'
'Eu Me Importo (2021).mp4'
'Loucura de Amor (2021).mp4'
thanks, any help would be appreciated.