Unix Shell - echo + quoting

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > February 2006 > echo + quoting





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author echo + quoting
seguso

2006-02-13, 6:04 pm

Hi,
very frequently I need to execute the command

sox `echo *.wav` whole.wav

but unfortunately this does not work if the filenames contain spaces.
Somehow I would like to ask "echo" to output quoted filenames. I can't
figure out how. Thanks for any help

Maurizio

Jean-Louis Liagre

2006-02-13, 6:04 pm

seguso wrote:
> Hi,
> very frequently I need to execute the command
>
> sox `echo *.wav` whole.wav
>
> but unfortunately this does not work if the filenames contain spaces.
> Somehow I would like to ask "echo" to output quoted filenames. I can't
> figure out how. Thanks for any help


what about "sox *.wav whole.wav" ?
seguso

2006-02-13, 6:04 pm

Thank you very much. Yes, I am an idiot :-)

Bill Marcum

2006-02-13, 6:04 pm

On 13 Feb 2006 07:38:34 -0800, seguso
<maurizio.colucci@gmail.com> wrote:
> Hi,
> very frequently I need to execute the command
>
> sox `echo *.wav` whole.wav
>
> but unfortunately this does not work if the filenames contain spaces.
> Somehow I would like to ask "echo" to output quoted filenames. I can't
> figure out how. Thanks for any help
>

sox *.wav whole.wav


--
"You can't teach seven foot."
-- Frank Layton, Utah Jazz basketball coach, when asked why he had recruited
a seven-foot tall auto mechanic
Stephane Chazelas

2006-02-13, 6:04 pm

On Mon, 13 Feb 2006 11:10:20 -0500, Bill Marcum wrote:
> On 13 Feb 2006 07:38:34 -0800, seguso
> <maurizio.colucci@gmail.com> wrote:
> sox *.wav whole.wav


sox ./*.wav whole.wav

or you'll have troubles if some file names start with "-".

I guess you'll also run into trouble if "whole.wav" exists at
the time that command is run.

--
Stephane
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com