Short-form license ?
Just wondering if there is some sort of short form of GPL 3 or 2 line I should put in the bash script?
No, there's no particular short form of that, nor there is a need to do so, and SE sites don't use GPL. (And on side note, most copyright texts state that you have to include copy - that is full copy - of the copyright notice; for example, GPL 3 states: "You should have received a copy of the GNU General Public License along with this program" ) However, what I would recommend doing is to add a comment, couple lines below your script's #!
line. Something like this:
#!/usr/bin/env bash
# Written by WinEunuuchs2Unix <https://askubuntu.com/users/307523>
# https://askubuntu.com/q/894460/295286
Adding such line will explicitly tell others that your content is originally written for Stack Exchange network, and all content on StackExchange Network is CC-BY-SA 3.0 (see the Notes for details). Therefore such line quickly tells that the script is under CC-BY-SA license and whoever is reproducing your code ( be it on reddit or elsewhere ) should give proper attribution. (Note that holds true unless you allowed choosing multiple licenses for your work, see "Practical considerations" section).
How to give attribution is outlined in this SE meta post by Bill the Lizzard, which actually draws from SE Terms of Service:
You must1: A) clearly indicate that it comes from the Stack Exchange Network, and give credit to the author by B) linking to the original answer/question, C) clearly indicating the author(s)' username, and D) providing link(s) to their profile page(s)
See also Jeff Atwood's blog post on the same topic. To be perfectly fair, whoever asked you to republish the code didn't have to ask you so long as the attribution requirements are met, but it is awfully nice of them ( and please note that's just my opinion based on interpreting the attribution requirements).
Practical (maybe slightly depressing) considerations
Let's go on a tangent: Can you license your own answers at all on SE network or can you license via your profile ? Yes, Yes, and Yes. To quote Martijn Pieters's comment: "...the content you post on SO is not exclusively licensed. You are only agreeing to grant a specific license to reuse your work. There is no ownership transfer, the content is still yours to use elsewhere as you please. That gives you the right to do other things with your content, including granting more licenses." Also, as mentioned in answer on our dear moderator Oli's question:
You give up one big thing by posting it here:
- Your right to stop us (and others who see it here) from sharing it with others who can be helped by it, provided they include the required attribution.
But if you license your answers:
- you can't take away rights that SE license gives
- additional licenses should be compatible or even more permissive than CC-BY-SA (which is kinda same as the above)
- whoever is reusing your work can choose the license by which they will abide, so they can choose to use CC-BY-SE or the other license. If you licensed your code under license that doesn't require attribution, don't be surprised if the user chose that one and didn't give your answer credit.
That said, you mentioned GPL license. The SE license is not GPL compatible as noted in this answer. I wouldn't recommend using GPL, but that's my opinion only. Also, stay away from crayon licenses.
Practically speaking,though, licensing your code on SE answers is a very big, hairy, and uncombed mess.
Realistically, there is absolutely nothing stopping anyone from copying and using code without attribution (even if it has license slapped all over it), unless someone starts actually auditing the copied/modified work or calls out the copycat. Enforcing the license also can be problem, especially in case of "crayon licenses" or in case if you reuse your content for actual projects. To quote ArtOfCode:
Essentially, someone can get my code from somewhere I use it - perhaps in a commercial open-source product of mine - and not attribute it to me. When I chase them down on that, they can simply claim "oh, I got it from Stack Overflow", and get away scot-free
There is really no consensus how much is copyrighted and how much is covered by fair use. To quote Jeff Atwood: "...a snippet of code falls under excerpt category and thus should be free to use under fair use. Heck, we don't even support giant masses of code being posted, so to me, by definition, everything would be an excerpt." Problem is that there is no definition of how long is snippet of code. 3 lines ? 10 lines ? Who knows ?
- Proving original authorship with SE answers can be difficult if not impossible, can even backfire. See this answer for example.
Now because I've sat reading all sorts of sources for over 3 hours now and because I need a break from sitting in front of monitor, I'll leave a few my own opinions in conclusion: treat answers on AskUbuntu as if they are in public domain (even if you will hear everybody on the network say SE is not public domain, because technically public domain is not copyrighted, but SE is copyrighted under permissive license). As 200_success said, "The intention is to share code for discussion, not to give code away". Problem is that one persons intention doesn't prevent another's from just taking code as if it was given away. For inspiration take a look at L.H.O.O.Q.. If you want to really protect code and enforce some sort of license:
- create MCVE
- host code on source hosting sites like GitHub, license them appropriately, and link to the code - don't post it into answers
- provide code in answers which you don't intend to use in serious commercial projects or modify it to suit the commercial project
- just treat answers as discussion given in good faith that it will be useful to OP (and someone who stumbles upon it).
I'm not a lawyer,though, so treat this answer with grain of salt.
Addressing the "small children" scripts
In your comment you said (emphasis added by me):
By small script I meant those little children the parent script calls. The parent script would still have full license text. The parent is the most important for functionality / intellectual property rights. The children just do small menial little tasks...
OK, pay very very close attention to the highlighted parts, because they will be important. First we need to go back to the very very very basics. Copyright means who owns the code, License - how people are allowed to use that code ( rolfl ). But, to be considered copyrighted, code must be an original work and originality is most important factor ( Aneurysm9 ) .
By that definition, the cron and conky portions that I see in your answer cannot be copyrighted, which means they can't have license. They're just not substantial enough to be considered an original work.
Note also, that there exists something as Abstraction-Comparison-Filtration test to determine substantial similarity. Substantial similarity is actually a legal term. Important part of it, IMHO, is the following:
If there is substantial similarity in ideas, then the trier of fact must decide whether there is substantial similarity in the expressions of the ideas so as to constitute infringement.
In case of cron and conky type of stuff, there is likely chance that there's plenty of cron and conky settings that are very very similar to yours and claiming copyright on them via any license seems slightly ridiculous.
However, you could maybe copyright (in my humble and non-lawyer opinion) the two spinner scripts in your answer for Can BASH display in systray as application indicator?. They seem original enough, although I doubt in an actual court printing four characters in sequence would make the script original.
That said, think about what your scripts are actually doing: one reads file and checks character in it and writes another to it, the other - checks that file and echoes the character. There will be enough scripts that have similar idea, although may use slightly different expression. I think it would be also great if you could rewrite the script somehow to make it one unit, which does all the work, spinning and echoing - that will limit possibilities for substantial similarity in execution.
Notes
To quote Terms of Service:
You agree that all Subscriber Content that You contribute to the Network is perpetually and irrevocably licensed to Stack Exchange under the Creative Commons Attribution Share Alike license. You grant Stack Exchange the perpetual and irrevocable right and license to use, copy, cache, publish, display, distribute, modify, create derivative works and store such Subscriber Content and, except as otherwise set forth herein, to allow others to do so in any medium now known or hereinafter developed (“Content License”) in order to provide the Services, even if such Subscriber Content has been contributed and subsequently removed by You.
There has been effort in 2016 to move towards MIT license but as said on the link, this has been postponed indefinitely.