[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Home made backup system



On Wed, Dec 18, 2019 at 10:38:26PM -0500, songbird wrote:
> rhkramer@gmail.com wrote:
> ...
> >>   if test -z "$home" -o \! -d "$home" ; then
> >
> > What does the -o \! do -- hmm, I guess \! is a bash "refeence" to the owner -- 
>   no, -o is logical or in that context.

Yes, exactly: it's not bash operating on that, but test [1],
so for bash it's a plain old parameter passed to test.

> the backslash is just protecting the ! operator 
> which is the not operator on what follows.

Again, this is supposed to be passed to test unharmed,
so the \ is telling bash "nothing to see here, pass
along).

>   i'm not going to go any further with reading
> whatever script that is.  i don't want to be
> here all evening.  ;)

Shell can be entertaining, can't it [2]?

Cheers

[1] Of course, this was a little white lie: there is a /bin/test,
   but for bash "test" is a built in, so it's part of bash anyway,
   but it behaves as if it were a binary. Oh, my ;-)

[2] Recommended: Greg Wooledge's pages. He's a regular here. He
   knows much more about shells than me!
   https://mywiki.wooledge.org/

-- tomás

Attachment: signature.asc
Description: Digital signature


Reply to: