4 ms·
This had become a discussion of the best way to write the "shell macro" version that could replace the node.js program fls () { find . -maxdepth 1 -type f
by tingletech 6y ago
This had become a discussion of the best way to write the "shell macro" version that could replace the node.js program
fls () {
find . -maxdepth 1 -type f
}
vs
fls () {
find . ! -path . -prune \
-type f \
-exec sh -c 'for p; do printf '\''%s\n'\'' "${p##*/}"; done' - {} +
}
The user would just type `fls` in the directory they were exploring.