can you make a shell script for linux that can load urls in a text file and play the…
Jump to turn (7)
- 1can you make a shell script for linux that can load urls in a text file and play
- 2how do i point it to the text file that has urls
- 3can the script have a input field for the text file name
- 4line 12: syntax error near unexpected token fi'
- 5still getting line 12: syntax error near unexpected token fi'
- 6i am using /bin/bash and am getting this error line 12: fi'
- 7script still says the fi is wrong sadly
- User
can you make a shell script for linux that can load urls in a text file and play the links in mpv without video and also display what is playing
- Assistant
Yes, here is a possible shell script that does what you've described:
code#!/bin/bash # Get the filename of the text file with URLs if [ -z "$1" ]; then echo "Usage: $0 <urls-file>" exit 1 fi urls_file="$1" # Loop over the URLs in the file while read url; do echo "Playing ${url}..." mpv "${url}" --no-video done < "${urls_file}"Save this script as a file (e.g. ), make it executable (), and run it with the filename of the text file with URLs as argument: