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 ?

1 Answer 1

3

If you are creating something for other people to use, a self-contained script they can put in their PATH and replace with new versions as needed is far easier, better, and maintainable than a function that will require them editing their startup files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.