Re: To have find to not print, ie. to supress, when a condition

2020-12-12 Thread Bernhard Voelker
On 12/12/20 4:56 AM, Budi wrote:
> How do we have find to not print, ie. to supress, when on else condition ?
> 
> find .  -path '*/*t*s' \( -type d -printf "DIR:%p\n" -o -printf "**%p**\n" \) 
> -o -print
>   
> ^
> 
> The pointed out by arrow alternative  -printf "**%p**\n" is intended
> to be instructing to suppress it instead"
> 
> How to solve it as if it's omitted altogether it'll be printed out?
> Thanks before

First of all: you reached to GNU coreutils mailing list where the discussions 
are about
tools like cp, mv, tail etc., but not about find which is in the separate GNU 
findutils
package.  Thus, I'm there adding their mailing list.

>From the command line show above, it's not really clear to me what you want
to achieve or where the problem is.  I mean if you don't want the final "-o 
-print"
to print something, then why don't you just omit it from the command line?
This seems to work just fine (depending on what you want to achieve):

  find .  -path '*/*t*s' \( -type d -printf "DIR:%p\n" -o -printf "**%p**\n" \)

Regarding an "else condition", it might be worth reading about '-prune' in the
GNU findutils documentation.

Have a nice day,
Berny



To have find to not print, ie. to supress, when a condition

2020-12-12 Thread Budi
How do we have find to not print, ie. to supress, when on else condition ?

find .  -path '*/*t*s' \( -type d -printf "DIR:%p\n" -o -printf
"**%p**\n" \) -o -print
  ^

The pointed out by arrow alternative  -printf "**%p**\n" is intended
to be instructing to suppress it instead"

How to solve it as if it's omitted altogether it'll be printed out?
Thanks before



Re: To have find to not print, ie. to supress, when a condition

2020-12-12 Thread Bernhard Voelker
On 12/12/20 2:35 PM, Budi wrote:
> How do we have find to not print, ie. to supress, when on else condition ?
> 
> find .  -path '*/*t*s' \( -type d -printf "DIR:%p\n" -o -printf
> "**%p**\n" \) -o -print
>   
> ^

This is the same question as before - and now on the correct mailing list.

> The pointed out by arrow alternative  -printf "**%p**\n" is intended
> to be instructing to suppress it instead"

I'm still not sure what exactly you wanted to achieve.
Please provide more context, at best a little reproducer:
i.e., a small example directory hierarchy, and what output you got,
and what output you expected instead.

Have a nice day,
Berny