Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] Quick question: how to call a script function from "find"?
On 2017-06-13 13:59, Bernhard Voelker wrote:
On 06/13/2017 01:55 PM, Carlos E. R. wrote:
On 2017-06-13 13:42, Per Jessen wrote:
Carlos E. R. wrote:

I don't quite see the difference with $* :-?

$* is a single string/argument, $@ is an array.


But in this case, both would result in generating the proper command
line to the chmod commands, nor?

Actually, a single argument may be the right thing, being a directory
name with spaces. I may get a name with two spaces!

Well, that's exactly the problem: if the script gets another argument
and that may also have spaces, then the array variant "$@" will work

Thus, I'm almost never using "$*".

And BTW: it's always a good idea to use double quotes around "$@",
because otherwise the called program/snippet will have the same problem

Ok, noted in my notes :-)

Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >