Re: [SLUG] mplayer and symbols in file name

From: Eben King (eben1@tampabay.rr.com)
Date: Mon May 10 2004 - 16:34:57 EDT


On Mon, 10 May 2004, Ronan Heffernan wrote:

> Steve wrote:
>
> >If I try to play a song from a script like this:
> >
> >song="/home/s/MyMusic/mohmp3/enya.mp3"
> >mplayer "$song"
> >
> >It does not work.

Is mplayer an alias or script? Run "type mplayer" to see. "$song" should
be expanded by the calling shell, so that syntax should work regardless.
Now if you're using single quotes and that isn't a direct copy&paste,
that's why it doesn't work. (echo '$song'; echo "$song")

> >From the cmdline I can type
> >mplayer /home/s/MyMusic/mohmp3/enya.mp3
> >
> >it plays fine.
> >
> try:
>
> export song="/home/s/MyMusic/mohmp3/enya.mp3"

That's a bashism, a shortcut for

song=/home/s/MyMusic/mohmp3/enya.mp3 ; export song

No quotes are needed around /home/s/MyMusic/mohmp3/enya.mp3 , as it
contains no characters special to the shell. But for other songs, quotes
may be required.

> mplayer $song
>
> Note the 'export' and the lack of quotes around $song.

Also the lack of $ . Is it necessary that there be no quotes?

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar

Q: What kind of modem did Jimi Hendrix use? A: A purple Hayes.

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:05:10 EDT