ref: 5a782aaa278e0942e783e80b3d39dfb1fa6018b9
parent: cd377d6f716a885efe83fe8e6fed3c5c4e502517
author: Alex Musolino <alex@musolino.id.au>
date: Mon Jun 18 09:11:03 EDT 2018
play(1): handle file names containing consecutive spaces
--- a/rc/bin/play
+++ b/rc/bin/play
@@ -1,6 +1,8 @@
#!/bin/rc
rfork e
+nl='
+'
out=/dev/audio
typ=()
tmp=()
@@ -31,7 +33,7 @@
if not { switch($2){case *plain*
- sed 's/
//g' | while(j=`{read}){+ sed 's/
//g' | while(j=`$nl{read}){echo $"j >[1=2]
if(~ $"j http:* https:* HTTP:* HTTPS:*){hget -r 'User-Agent: play' -r 'Icy-MetaData: 0' $"j | play1 $"j
@@ -104,5 +106,5 @@
>$out { if(~ $#* 0){play1 stdin; exit}- for(i){echo $i} | play1 args plain+ for(i){echo $"i} | play1 args plain}
--
⑨