changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: play(1): handle file names containing consecutive spaces

changeset 6597: 2dbf69ebf7d3
parent 6596: 330a4eaf43d2
tag:tip
author: Alex Musolino <alex@musolino.id.au>
date: Mon, 18 Jun 2018 13:11:03 +0930
files: rc/bin/play
description: play(1): handle file names containing consecutive spaces
     1.1--- a/rc/bin/play
     1.2+++ b/rc/bin/play
     1.3@@ -1,6 +1,8 @@
     1.4 #!/bin/rc
     1.5 rfork e
     1.6 
     1.7+nl='
     1.8+'
     1.9 out=/dev/audio
    1.10 typ=()
    1.11 tmp=()
    1.12@@ -31,7 +33,7 @@ fn play1 {
    1.13 	if not {
    1.14 		switch($2){
    1.15 		case *plain*
    1.16-			sed 's/
//g' | while(j=`{read}){
    1.17+			sed 's/
//g' | while(j=`$nl{read}){
    1.18 				echo $"j >[1=2]
    1.19 				if(~ $"j http:* https:* HTTP:* HTTPS:*){
    1.20 					hget -r 'User-Agent: play' -r 'Icy-MetaData: 0' $"j | play1 $"j
    1.21@@ -104,5 +106,5 @@ while(~ $1 -*){
    1.22 
    1.23 >$out {
    1.24 	if(~ $#* 0){play1 stdin; exit}
    1.25-	for(i){echo $i} | play1 args plain
    1.26+	for(i){echo $"i} | play1 args plain
    1.27 }