1 |
On Tue, 30 Aug 2011 09:26:16 +0200 |
2 |
Tomáš Chvátal <scarabeus@g.o> wrote: |
3 |
|
4 |
> >> # @FUNCTION: office-ext_remove_extension |
5 |
> >> [...] |
6 |
> >> ${UNOPKG_BINARY} remove --shared "${ext}" \ |
7 |
> > |
8 |
> > Not sure what unopkg accepts, but I guess you want to pass several |
9 |
> > arguments here. So ${ext} shouldn't be quoted. |
10 |
> > |
11 |
> > And why is the intermediate variable ext needed here, in the first |
12 |
> > place? You could use "$@" directly (this time, with the quotes). |
13 |
> > |
14 |
> Nah i want to give it just one argument, the name of the extension |
15 |
> and it can contain spaces -> $@. |
16 |
|
17 |
Then you are supposed to use "${1}", and caller is supposed to quote |
18 |
that name. |
19 |
|
20 |
Running things like 'foo bar baz' is a no go. If the file was named |
21 |
'bar baz' instead, it'd fail because of whitespace collapsing. So, |
22 |
the only allowed solution is 'foo "bar baz"', and ${1}. |
23 |
|
24 |
> For what is worth i prefer to use local variables just because it is |
25 |
> easier if I decide to change what i want to parse from $@ to |
26 |
> something else. |
27 |
|
28 |
BTW You can go with exts=( "${@}" ) as well, to support multiple exts. |
29 |
|
30 |
-- |
31 |
Best regards, |
32 |
Michał Górny |