[OpenWrt-Devel] [PATCH v4] base-files: add /etc/profile.d support

Luiz Angelo Daros de Luca luizluca at gmail.com
Fri Sep 4 11:09:35 EDT 2015


Normally I like to use find instead of glob
With minpath, maxpath, name and etc, you get safe empty result when dir is
empty.

Regards,

Em sex, 4 de set de 2015 10:10, Bastian Bittorf <bittorf at bluebottle.com>
escreveu:

> * Karl Palsson <karlp at tweak.net.au> [04.09.2015 15:02]:
> > So let's -d test the directory instead of -e testing every file just in
> > case the directory didn't exist?
>
> even if the directory exists but is empty, the globbing fails.
> but i get your point. what about:
>
> [ -n "$( ls -1 $dir )" ] && {
>   for FILE in $dir/*; do
>     . "$FILE"
>   done
> }
>
> but i dont like it! any other comments
>
> bye, bastian
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150904/452da10b/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list