0

I'm writing a small script to manage my installed JDK on a linux machine, say for example that the name of the script/function is usejdk.

I come with to ways :

  1. usejdk is a bash function in shell script sourced the file in .bashrc or .bash_profile.

  2. use usejdk as the name of the shell script and add it to the ~/bindirectory which is the PATH.

What is the idiomatic way to deploy a shell script on a unix machine between the two ?

4

1 回答 1

3

如果您正在创建供其他人使用的东西,那么他们可以放入他们的独立脚本PATH并根据需要替换为新版本,这比需要他们编辑启动文件的功能更容易、更好且可维护。

于 2013-05-11T17:48:48.723 回答