Re: Executing Shell Pipelines with “find -exec”

Liste des GroupesRevenir à cu shell 
Sujet : Re: Executing Shell Pipelines with “find -exec”
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.shell comp.os.linux.misc
Date : 27. Apr 2024, 23:46:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v0jv7l$k8gh$4@dont-email.me>
References : 1 2
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Sat, 27 Apr 2024 13:40:52 -0000 (UTC), Christian Weisgerber wrote:

This is problematic because the filename is simply interpolated into the
command string, which is then interpreted by sh.  If the filename
contains whitespace or shell meta-characters, the results will be
unexpected.

That is true. I only realized it later, after posting.

You pass the filename as a positional parameter and reference it as such
in the command string.

Another possibility might be to use an environment variable. I have done
this in other scripts.

Date Sujet#  Auteur
27 Apr 24 * Executing Shell Pipelines with “find -exec”8Lawrence D'Oliveiro
27 Apr 24 +* Re: Executing Shell Pipelines with “find -exec”6Christian Weisgerber
27 Apr 24 i+* Re: Executing Shell Pipelines with ?find? _-exec?4Robert Heller
27 Apr 24 ii`* Re: Executing Shell Pipelines with ?find? _-exec?3Kaz Kylheku
27 Apr 24 ii `* Re: Executing Shell Pipelines with ?find? _-exec?2Robert Heller
5 May 24 ii  `- Re: Executing Shell Pipelines with ?find? _-exec?1Friedhelm Waitzmann
28 Apr 24 i`- Re: Executing Shell Pipelines with “find -exec”1Lawrence D'Oliveiro
5 May 24 `- Re: Executing Shell Pipelines with “find -exec”1Friedhelm Waitzmann

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal