energiya
September 5th, 2007, 07:33 AM
Hi,
I'm trying to build a script to interact with mpc. The thing is I can't get \n (new line) in a variable. The output should be:
Song Name
[playing] #1/12 4:13/5:22 (79%)
volume: 84% repeat: on random: on
but after a
soutput=`mpc`
echo "$soutput"
I get
Song Name [playing] #1/12 4:13/5:22 (79%) volume: 84% repeat: on random: on
I really need a new line.
Basically, how do I keep new line when assigning var_name=`command` ?
Thanks.
I'm trying to build a script to interact with mpc. The thing is I can't get \n (new line) in a variable. The output should be:
Song Name
[playing] #1/12 4:13/5:22 (79%)
volume: 84% repeat: on random: on
but after a
soutput=`mpc`
echo "$soutput"
I get
Song Name [playing] #1/12 4:13/5:22 (79%) volume: 84% repeat: on random: on
I really need a new line.
Basically, how do I keep new line when assigning var_name=`command` ?
Thanks.