On Tue, 30 Aug 2011 09:26:16 +0200
Tomáš Chvátal <[email protected]> wrote:

> >> # @FUNCTION: office-ext_remove_extension
> >> [...]
> >>    ${UNOPKG_BINARY} remove --shared "${ext}" \
> >
> > Not sure what unopkg accepts, but I guess you want to pass several
> > arguments here. So ${ext} shouldn't be quoted.
> >
> > And why is the intermediate variable ext needed here, in the first
> > place? You could use "$@" directly (this time, with the quotes).
> >
> Nah i want to give it just one argument, the name of the extension
> and it can contain spaces -> $@.

Then you are supposed to use "${1}", and caller is supposed to quote
that name.

Running things like 'foo bar baz' is a no go. If the file was named
'bar  baz' instead, it'd fail because of whitespace collapsing. So,
the only allowed solution is 'foo "bar baz"', and ${1}.

> For what is worth i prefer to use local variables just because it is 
> easier if I decide to change what i want to parse from $@ to
> something else.

BTW You can go with exts=( "${@}" ) as well, to support multiple exts.

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: PGP signature

Reply via email to