Preserving Blanks in Parameters to Shell Script

Preserving Blanks in Parameters to Shell Script

Amos Shapira amos.shapira at gmail.com
Mon Jun 14 16:02:11 IDT 2010


On 14 June 2010 22:48, Aharon Schkolnik <aschkolnik at gmail.com> wrote:
> On Monday, June 14, 2010, Noam Meltzer wrote:
>> use $@ instead of $*
>
> Does that work for you ?
>
> I still get the same results - the script treates file\ one as two
> parameters - file and one.

1. Try switching to #!/bin/bash - I think the "$@" is a bash-specific
extension which might be disabled if bash is called as "sh".
2. Add double-quotes around the "$@", (ie. make it read 'nice ffmpege
"$@"' without the single-quotes)

BTW - if the "nice ffmpeg" is the last line in the script then you can
add an "exec" in front of it.

--Amos



More information about the Linux-il mailing list