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