4
pathway mtu discovery bash script
(gist.github.com)
Some stylistic notes
head -1
syntax is obsolete in POSIX, replaced by head -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
and dir
)Saved my bacon with this comment. Fixed a ton of (seemingly) innocuous errors.
100% use shellcheck! Saves so much time. Even better: https://github.com/bash-lsp/bash-language-server
Talk about the Bash Shell and Bash scripting