also names without escape characters don't seem to work.
Shell expansion doesn't work really well... If I have a local folder of `.pls` files, I can use something like
name>Name
url>/home/zplus/radios/epic\ rock\ radio.pls
but this instead doesn't seem to work
name>Name
url>~/radios/epic\ rock\ radio.pls
also names without escape characters don't seem to work.
By the way, I think the format of your .radiolist is a bit too complex... Is there a reason to use that format? Why not a simpler list like this
Name 1 | url_1
Name 2 | url_2
Name 3 | url_3
...
then you can just parse each line to retrieve (Name, URL) pairs
while IFS='|' read -r col_1 col_2; do
# Trim white spaces
col_1=`echo $col_1 | sed 's/[ \t]*//'`
col_2=`echo $col_2 | sed 's/[ \t]*//'`
echo "$col_1"
echo "$col_2"
done < radiolist_file
By the way, I think the format of your `.radiolist` is a bit too complex... Is there a reason to use that format? Why not a simpler list like this
Name 1 | url_1
Name 2 | url_2
Name 3 | url_3
...
then you can just parse each line to retrieve (Name, URL) pairs
while IFS='|' read -r col_1 col_2; do
# Trim white spaces
col_1=`echo $col_1 | sed 's/[ \t]*//'`
col_2=`echo $col_2 | sed 's/[ \t]*//'`
echo "$col_1"
echo "$col_2"
done < radiolist_file
I mostly chose the < character because I wanted to avoid characters commonly available in URLs like =, but this seems to be a more logical idea indeed. Every line is an entry.
That's a good idea!
I mostly chose the `<` character because I wanted to avoid characters commonly available in URLs like `=`, but this seems to be a more logical idea indeed. Every line is an entry.
Shell expansion doesn't work really well... If I have a local folder of
.pls
files, I can use something likebut this instead doesn't seem to work
also names without escape characters don't seem to work.
By the way, I think the format of your
.radiolist
is a bit too complex... Is there a reason to use that format? Why not a simpler list like thisthen you can just parse each line to retrieve (Name, URL) pairs
That's a good idea!
I mostly chose the
<
character because I wanted to avoid characters commonly available in URLs like=
, but this seems to be a more logical idea indeed. Every line is an entry.