diff options
author | Martijn Dekker <martijn@inlv.org> | 2016-01-11 16:10:17 +0100 |
---|---|---|
committer | Martijn Dekker <martijn@inlv.org> | 2016-01-11 16:10:17 +0100 |
commit | b3b0545c7f1dd12ae203a8221d20a911803324d7 (patch) | |
tree | bfdbfa696a9bf7942244a8784751ce86dc51e855 /drafts | |
parent | a0aa994e17d646cf9d1dc54987376f84a2667cbc (diff) |
more robust parsing of 'ls' using 'read'
* Iterating through 'ls' output using 'for' is very brittle; it relies on word splitting and globbing can also mess it up. It's best to use globs directly, but if using 'ls' cannot be avoided, e.g. if you need to sort by date, at least we can use 'IFS= read -r $i' to read from a here-document filled with the 'ls' output, which leaves everything in file names intact except newlines.
* Other minor cleanups.
Diffstat (limited to 'drafts')
0 files changed, 0 insertions, 0 deletions