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

edgar.soldin at web.de edgar.soldin at web.de
Fri Sep 4 06:00:06 EDT 2015


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

as explained on
 http://mywiki.wooledge.org/BashPitfalls#for_i_in_.24.28ls_.2A.mp3.29

..ede
_______________________________________________
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