[PATCH] treewide: remove execute bit and shebang from board.d files

Ye Holmes yeholmes at outlook.com
Fri Feb 26 10:13:20 EST 2021


Very interesting indeed. I find the mailing-list is really
good place where developers can learn a variety of stuff.
I tested the two scripts with bash, the results are
effectively the same. It seems that $(. XXX) does try to
evaluate the output from XXX, but does not do it very well.

---
root at OpenWrt:/tmp# cat hello.sh
#!/bin/sh
echo 'echo "Hello World!" ; exit 8'
root at OpenWrt:/tmp# cat source.sh 
#!/bin/sh
$(. /tmp/hello.sh)
exit 9
root at OpenWrt:/tmp# sh ./source.sh
"Hello World!" ; exit 8
root at OpenWrt:/tmp# echo $?
9
root at OpenWrt:/tmp# sh hello.sh
echo "Hello World!" ; exit 8

Modify hello.sh, try again with printf:

root at OpenWrt:/tmp# cat hello.sh
#!/bin/sh
echo 'printf "Hello %s!" "World" ; exit 8'
root at OpenWrt:/tmp# sh ./source.sh
"Helloroot at OpenWrt:/tmp# echo $?
9



More information about the openwrt-devel mailing list