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@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to