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

Karl Palsson karlp at tweak.net.au
Fri Sep 4 07:58:23 EDT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

edgar.soldin at web.de wrote:
> On 04.09.2015 11:51, karlp wrote:
> > include() {                                                  
> >         local file                                                         
> >                                                                         
> >         for file in $(ls $1/*.sh 2>/dev/null); do         
> >                 . $file                          
> >         done                                     
> > }         
> 
> note from a bystander. this looks wrong - path/file names containing
> spaces will be delimited by for. probably better use
> 
> for i in "$1/*.sh"; do
>     [ -e "$i" ] || continue
>     some command "$i"
> done


I agree, but that's a bug in the existing file...

http://git.openwrt.org/?p=openwrt.git;a=blob;f=package/base-files/files/lib/functions.sh;h=2f78d67025d0f52968fb47d6ee60a8b1163b5e6a;hb=HEAD#l238

Cheers,
Karl P

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJV6YdfAAoJEBmotQ/U1cr2KXoP/3b1CElNMVPs9ndPgGZmB6dR
M8C5AUoiBbdL3uHaMhC4UTmZdeQPn/C3jr++C5WGlV/x0tRYmYDGc1G5jvDi5SAi
Ljn7wqkac2a5VURg1pBb4t5PCH+MMcqabvTYxafmmpBYv1eOW7/QNldUeaZ02h3H
G8rVKhUWJ0mImWItZ/kIpGfOked9IcFG1A6Sy3l2hq3bIzFK0NnXrfRmpPJxxGqk
XIn2olQEkYXgji840lgol3QqlGF4yMA4Ml51+JZPRJ5tmYv2REfokAz+YXBB7CUr
Z4UHFP+RhKz+3tgv92sf+Wa8ch0XaYG37HDakcgrqQHZ/u4DQeQL9hFH1YUhWDrj
KkS8MkaoXrCxQ9sfxnf7ojQ/i7q762SZa4I47sB0b4BlXLGAKIRNPEGnuIXUGf0h
ik0tY5Ejr4LEaRaFgF//c6PinNU/wuIXPnuhqFLZQaswAUf0PztOJ7mUVPWO1ub3
Q16KgID7Z+Fq7x4XO5WByb3MM7qRJLlOXHH430+StaQWD6Uq0diB/IjfgoTbgqxq
qWArsFyIg3gGgDMNTY/uZCzL+TiUo3+BeF9NOe/aSw83/MDAJcvvt2pvw2hllzHJ
kZ+C1gQ/LisAnknGu3yBDOH2RsjoGgsLoubqvZIlYaEgCI61gtgjXPLxSoPV6pAy
onO1KZfWnAH7ug8XVXC0
=k5kM
-----END PGP SIGNATURE-----
-------------- 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