Xfmedia Question

tomw at videotron.ca tomw at videotron.ca
Thu Jun 28 21:48:52 CEST 2007


This is the script I wrote .... 

#!/bin/bash
#Enables file open / browsing functionality in Xfmedia.
#Called from Thunar
#Date 28/JUN/2007

XFMEDIA=`ps -e | grep -i xfmedia | awk '{ print $1 }'`
echo $XFMEDIA


TRACK = `echo $1 | sed 's/\ /\\\&/g'`

if [ -z "$VMWARE" ]; then
    xfmedia $TRACK
else
    xfmedia-remote -a $TRACK
fi

The script fails when the path / file name has a blank space in it.

$1=Babe Ruth-TheRunaways.mp3

I thought if I used sed to insert the escape character \ before a blank space, the problem
would be solved.  Wrong ... although this approach seems to work when steps are performed
from a command line.

What have I done wrong this time?





More information about the Xfce mailing list