On Fri, 26 Feb 2021 14:52:07 +0100, Adrian Schmutzler wrote:
> Can somebody enlighten me what we achieve with the $() enclosing
> the sourcing command?

Compared to the results a moment ago, $(. XXX) does try to evaluate
output from XXX script:

root@OpenWrt:/# cat /tmp/source.sh
#!/bin/sh
$(. /tmp/hello.sh)
exit 9
root@OpenWrt:/# cat /tmp/hello.sh
#!/bin/sh
echo 'exit 8'
root@OpenWrt:/# sh /tmp/source.sh
root@OpenWrt:/# echo $?
8

Removing shebang from scripts without .sh suffix (such as
/etc/board.d/02_network), it would be difficult to highlight
the syntax automatically when opened with editors (e.g. Vim)
on host.

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to