On Mon, Apr 22, 2019 at 01:35:02PM -0700, Evan Gates wrote: > On Mon, Apr 22, 2019 at 1:25 PM Adrian Grigore > <adrian.emil.grig...@gmail.com> wrote: > > > > ls -1 "$1" | while IFS= read -r p > > do > > Not sure about the preprocessor stuff, but this right here is terrible > practice. Use a for loop and glob. Assuming that "$1" is a directory: > > for p in "$1"/*; do ... > > http://mywiki.wooledge.org/ParsingLs >
What if "$1" is empty? POSIX sh doesn't have the nullglob shop, you know.