What does this do in bash: [@]?

Jon LaBadie ubu at labadie.us
Sat Jul 30 16:40:19 UTC 2022


On Sat, Jul 30, 2022 at 02:22:06PM +0200, Bo Berglund wrote:
...
>
>I am looking at a download script where this construct exists:
>
>CURL=$(command -v curl) #Get full path to the curl command
>
>FFMPEG=$(command -v ffmpeg) #Get full path to the ffmpeg command
>
>URL=('https://tokens.xxxxx.com/' -d $'{\n "pid": "2007524",\n "application":
>"Sports",\n "platform": "desktop",\n "cdn": "akamai",\n "url":
>"https://xxxxxxx.akamaized.net/hls/live/723429/Sportsa418c506/clear/master.m3u8"\n}')
>
>INPUT=$("$CURL" -qsS "${URL[@]}"  | jq -Mr '.akamai[] | .tokenizedUrl')
>
>I want to understand what is going on in here so I can modify it to get what I
>want...
>
>The INPUT variable is later used in an ffmpeg call as "${INPUT[@]}" like this:
>
>CMD="ffmpeg -hide_banner -i \"${INPUT[@]}\" -vf scale=w=-4:h=480 -c:v libx264
>-preset fast -crf 26 -c:a aac -t ${CAPTURETIME} ${TARGETFILE}"
>
>eval "$CMD"
>
>And this works with ffmpeg but I want to find a way to extract the m3u8 URL
>itself so it can be used in strm files in KODI running on my Ubuntu machine for
>direct live viewing too.
>
>I have added a printf statement in the script to send $INPUT to a file before it
>uses it so I can look at it afterwards and it does not looking like any URL I
>recognize or can use. But ffmpeg seems to be fine with it...
>
Perhaps:

   eval echo "$CMD"

or

   eval printf "%s\n" "$CMD"


-- 
Jon H. LaBadie                  ubu at labadie.us




More information about the ubuntu-users mailing list