News for hackers. Stuff that matters.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by metadat on Tuesday June 20, 2023 @01:04PM (#36407093)
Here are a few examples of how I safely traverse filesystem contents in bash:

  find . -print0 | xargs -0 -n1 ./sub_script.sh

  find . -mindepth 1 -maxdepth 1 -name '*some*pattern' -print0 \
    | xargs -0 -n1 -I{} /usr/bin/env bash -c \
      'printf "%s" "$*"' _ {}

There are no comments on this comment yet.