若某 port 為了執行其他程式而安裝了一個 shell script,
而該程式同時也是該 script 最後一個動作,那麼需要確定該 script
是用 exec
述句(statement),舉例而言:
#!/bin/sh exec %%LOCALBASE%%/bin/java -jar %%DATADIR%%/foo.jar "$@"
exec
述句以所指定的程式取代了該 shell
的程序。 若省略 exec
,那麼該 shell 程序
將會在程式執行中一直存在於記憶體,這無疑地浪費了系統資源。
All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/
Questions that are not answered by the
documentation may be
sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.