sh packaging

I wrote a sh program with many options and lot of cool stuff and I will to learn how to package it. So ppl could downlaod it and use it just like ls cp ..
So if I have BUX.sh
ppl could type
BUX -r-r
on the command line and it just work
or I could have
BUM man

Also I like to offer them to update as I find any issue with the code

So How would I publish my sh/[any type of ] code

If you want to run your script as ls or cp commands.

For this,we need to give execute permission for that script.

If the script contains execute permission,then we can run it without using sh command.

Simply,giving the script name is enough.

What OS did you write the script for? If it's Linux, is it specific to a certain distribution / do you have a preference?

With Linux (can't say anything about other Unices) you have 2 options:

  1. find a maintainer that takes care of the packaging
  2. maintain the package yourself

If you go with 2. (which is usually the case with new software), learn the packaging format and common layout for your chosen distribution. Then, submit it to said distribution for a review. If the packaging team decides that your package is stable enough, it might get included in the next release.

If you want to stay independent, you'll have to do that yourself. However, that will probably also mean no automatic updates, since setting up your own repository isn't really trivial.

Be sure that you have added a sha-bang characters ,

so when u run the script with out the sh , then #!/bin/bash ( sha-bang ) only
tells the interpreter how to run the script.

This is applicable for all types of scripting language.

You need to be more specific about what you mean by "publish". Is this for distribution over the internet to anyone interested in running the code?Is it for distribution around a LAN or WAN maybe at work or a college? If so are there security restrictions in place?If you could be more specific about who you are publishing this for it would be easier to answer your question.