> To: BLFS Development List <[email protected]>
> From: Fernando de Oliveira <[email protected]>
> Date: Sat, 6 Feb 2016 10:48:59 -0300
> Subject: Re: [blfs-dev] Minor correction to curl install
>
> Em 06-02-2016 09:17, akhiezer escreveu:
> >> Date: Fri, 05 Feb 2016 17:47:27 +0000
> >> From: [email protected] (akhiezer)
> >> To: BLFS Development List <[email protected]>
> >> Subject: Re: [blfs-dev] Minor correction to curl install
> >>
> >>> To: BLFS Development List <[email protected]>
> >>> From: Tim Tassonis <[email protected]>
> >>> Date: Fri, 5 Feb 2016 17:48:14 +0100
> >>> Subject: [blfs-dev] Minor correction to curl install
> >>>
> >>> Hi all
> >>>
> >>> I just install curl from blfs and would suggest a minor correction to 
> >>> the install section:
> >>>
> >>> find docs \( -name Makefile\* \
> >>>            -o -name \*.1       \
> >>>            -o -name \*.3 \)    \
> >>>            -exec rm {} \;      &&
> >>
> >>
> >> (Also, '[-depth] ... -delete' instead of the '-exec rm {} \;' ? The
> >> latter isn't wrong; just a little unnecessary to call-out via '-exec' .)
> >>
> > 
> > 
> > The '-exec rm {} \;' will return false on dirs (& spew out
> > errors/warnings) - tho' not cause find() to return non-zero.
> > 
> > 
> > Normally that'd be tightened-up (proactively, defensively) a bit.
> > 
> > 
> > According to blfs svn for curl (
> > http://www.linuxfromscratch.org/blfs/view/svn/basicnet/curl.html ),
> > the intent of the find-rmv is to remove files.
> > 
> > 
> > So depending on whether it's just ordinary files, or just non-dirs,
> > then one would use '-type f' or '! -type d' after the 'docs' or at
> > least before the '-exec' (tho' of course some find() implems can/will
> > do some 'optimising'/rearranging of some parts of their cmdlines).
> > 
> > 
> > And for completeness, if dirs are to be included in the rmvl, then
> > one would normally use the '[-depth] ... -delete' construct instead
> > of the '-exec ...'  .
>
> Sorry to intrude, as it was not directed to me.
>
> Thanks for the valuable info.
>
> You are right: we are only removing files.
>


So:

  # If want to rmv regular files plus symlnks &c; but skip dirs quietly.
  #
  # Can use '[-depth] ... -delete' instead of the '-exec rm {} \;'  .
  #
  find docs ! -type d \
             \( -name Makefile\* \
             -o -name \*.1       \
             -o -name \*.3 \)    \
             -exec rm {} \;      &&

or

  # If only want to rmv regular files, but not symlnks &c.
  #
  # Can use '[-depth] ... -delete' instead of the '-exec rm {} \;'  .
  #
  find docs -type f \
             \( -name Makefile\* \
             -o -name \*.1       \
             -o -name \*.3 \)    \
             -exec rm {} \;      &&

or

  # If not 'openbsd-mmonkeys' mailing-list.
  #
  # Can use '[-depth] ... -delete' instead of the '-exec rm {} \;'  .
  #
  leave as-is / not-bothered (much/enough) / ok-ish, but can't-be-bothered / 
  won't-bother / "nah-let's-not-fkn-bovver" [Al Murray] .  ;)

?



rgds,
akh





--
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to