Ash wildcard usability bug

Bastian Bittorf bb at npl.de
Wed Oct 26 08:12:47 UTC 2016


* Kang-Che Sung <explorer09 at gmail.com> [26.10.2016 10:00]:
>     filename="`ls *zip | head -n 1`"
>     nc 10.0.0.1 12345 < "$filename"
>     do_something_else < "$filename"
> 
> Yeah. Just avoid the glob on the redirection and instead get the
> filename before that. Any difficulty?

better do (without pipes and cheating):

for file in *zip; do
  test -f "$file" && action...
done

bye, bastian


More information about the busybox mailing list