Skip to main content

Thread: Shell scripting for a total noob


making way open mp3's in xmms2 learn sh script
here's code

#!/bin/bash

x=$( pwd )
x2=$( echo $x/$1 )
x3=$( echo $x2 | sed 's/ /\\ /g')
x4=$( echo xmms2 add $x3 )
xmms2 stop
xmms2 clear
$x4 <----------(crashes here.)-(error: invalid url: 6\)
echo $x4 <--(when paste output terminal works)
xmms2 play


think runs $x4 "xmms2 add $x3"
.:and:.
xmms2 doesn't know how add variable playlist.

there way convert $3 plaintext , put command before xmms runs it?

+5 internets whoever can help!

is there particular reason why sequence of echos captured serve variables down road?

code:
#!/bin/bash  xmms2 stop xmms2 clear xmms2 add "$pwd"/"$1" xmms2 play
$pwd , $1 variables put in double quotes prevent segmentation on spaces assume wanted achieve sed line.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [kubuntu] Shell scripting for a total noob


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support