LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   bash script error? (https://www.linuxquestions.org/questions/linux-software-2/bash-script-error-4175537438/)

shams 03-21-2015 08:33 AM

bash script error?
 
This is a bash script running in loop reading the videos urls from the file urls and downloading with youtube-dl and then removing the downloaded video url from the file and starting to download the next video, when i run this code get this error:
Quote:

$ ./ydown.sh
./ydown.sh: line 4: /usr/bin/youtube-dl -c -v: No such file or directory
./ydown.sh: line 4: /usr/bin/youtube-dl -c -v: No such file or directory
Thsi is the ydown.sh:
Code:

#!/bin/bash
while read line
do
"/usr/bin/youtube-dl -c -v" $line
sed -i "\#$line#d" urls
done < urls

youtube-dl is installed in the /usr/bin:
Quote:

$ whereis youtube-dl
youtube-dl: /usr/bin/youtube-dl /usr/share/man/man1/youtube-dl.1.gz

T3RM1NVT0R 03-21-2015 12:14 PM

Just remove the quotes and it should work fine:

Code:

#!/bin/bash
while read line
do
/usr/bin/youtube-dl -c -v $line
sed -i "\#$line#d" urls
done < urls1


shams 03-22-2015 09:04 PM

Thanks for reply that works.

T3RM1NVT0R 03-23-2015 12:07 AM

Good to hear that please mark the thread as solved!


All times are GMT -5. The time now is 07:28 PM.