LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to share a bash script? (https://www.linuxquestions.org/questions/programming-9/how-to-share-a-bash-script-4175702827/)

Racho 10-30-2021 06:05 AM

How to share a bash script?
 
Hi there

I've made a bash script that adds several .csv files into a .ods spreadsheet.

Sometimes i code just for fun, I'm not a software developer and I never get my code reviewed by anyone.

Now I would like to share this script hoping that someone can find it useful and to get the chance to learn something from other people's commnents about it.

Where should I post it?

shruggy 10-30-2021 06:16 AM

GitHub?

jmgibson1981 10-30-2021 06:18 AM

I'm not sure there is a place for that really. One thing I do is when I see a thread on the topic I will sometimes link my script from my gitlab. I also will occasionally direct post functions from my scripts sometimes if they contain something I think will help someone on a given topic.

boughtonp 10-30-2021 07:04 AM


 
Before you share it anywhere, check with with ShellCheck to identify any obvious issues.

For sharing/reviews, if you don't want to self-host there are a number of online code repositories where projects can be hosted.

GitHub is the most popular, but many people dislike that it is proprietary and now owned and run by Microsoft, and there are plenty of other options - Wikipedia has a comparison: https://en.wikipedia.org/wiki/Comparison_of_source-code-hosting_facilities

If you don't think the script merits a project of its own, you can simply create a project "Racho's Scripts" (or whatever) and add scripts as and when you feel like it.
(But either way, to share the code with others you should make sure you clearly indicate a license - see https://choosealicense.com/licenses/ for options.)


Racho 10-30-2021 09:32 AM

Thanks boughtonp

Shell check got some issues and I will work on them before posting

to choose a license is enough to write it at the beginning or I have to do something else?

I will take a look at those repositories.

Thanks!

boughtonp 10-30-2021 11:04 AM


 
If you have a readme file stating what the license is, plus a license file containing the wording, that would probably be clear enough for most people.

If you're including code written by others, you'd need to identify that in some obvious way (e.g. in a credits/licensing section of the readme).

For extra clarity, I tend to include a single-line header with each non-trivial file I've written, e.g : "# <project name+version> | (c) <my name> | License: <license> | Website: <url>"

(The FSF/GPL recommend using several paragraphs of text at the start of every file for that purpose, so that's something you'll see quite often. I consider that overly-verbose bloat.)

For Bash scripts, the "#!/bin/bash" line needs to be at the front, so the above would go on the second line.

(Disclaimer: I'm not a lawyer; this post is my opinion and not legal advice.)


dugan 10-30-2021 11:16 AM

Our Member Success Stories forum! If the script is long, put it on gist.github.com and post the link there.

Racho 10-31-2021 02:31 AM

Hi dugan

I posted in sourceforge.

This is the link

https://sourceforge.net/projects/addcsv2ods/

My problem now is that don't know how to do anything there and there are a lot options so I'm a bit lost there.

I chose sourceforge because at first glance seemed easier than github to me.

Turbocapitalist 10-31-2021 02:52 AM

GitHub is proprietary and owned by M$, there's a lot of problems with that both technical, economic, and political. Further there have been several exoduses since it was acquired by M$ so it is far from the best choice.

SourceForge was the go-to service for many years, but I have lost track of who owns it and why it is so much less popular than before. It has been many years since I've used it, but if I understand correctly you have your choice of version control systems. The main one in the old days was CVS. Then there were several competing choices for a while and when the dust settled, Git seems to have come out on top. Git has nothing to do with GitHub, despite the name. Anyway, if I recall correctly you can either upload to SourceForge using SFTP or Rsync or else check in your work using Git. Using Git is the more useful approach in the long term if you are interested in programming as it is needed for collaboration.

So try starting here, starting with creating a new project:
https://sourceforge.net/p/forge/docu...n/Docs%20Home/

source hut is also a reasonable choice, as is self-hosting.

Racho 10-31-2021 03:15 AM

Hi Turbocapitalist

I uploaded the file via web, it was just the easiest way.

Version control systems was not really a choice. I just had to choose one option and all them were new to me, so I just took one without really knowing what was I doing ... I suppose this is something I can change whenever i want, i just have to figure it out how.

Quote:

So try starting here, starting with creating a new project:
https://sourceforge.net/p/forge/docu...n/Docs%20Home/
Thanks I will read it!
I was needing a tutorial to use that web properly.
I may end up hosting the script in git, but first I need to get more familiar with all that environment that is new to me. This can take me some time though because I make this in my spare time.


All times are GMT -5. The time now is 12:13 PM.