this post was submitted on 30 Apr 2025
3 points (80.0% liked)
Bash
892 readers
1 users here now
Talk about the Bash Shell and Bash scripting
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Some stylistic notes
head -1
syntax is obsolete in POSIX, replaced byhead -n 1
.for filename in $(ls)
is inefficient and will break on whitespace. You can use shell globbing for this instead, e.g.,for filename in *
./tmp/ dir
, I believe it will remove/tmp
anddir
)Saved my bacon with this comment. Fixed a ton of (seemingly) innocuous errors.