What are bash packages?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite
1












The Google bash style guide mentions bash packages, where the package name should be separated from the function name by double colons




If you're writing single functions, use lowercase and separate words with underscore. If you're writing a package, separate package names with ::. Braces must be on the same line as the function name (as with other languages at Google) and no space between the function name and the parenthesis.




# Single function
my_func()
...


# Part of a package
mypackage::my_func()
...



I've googled but found no references to bash packages except for the Lightweight bash Package Manager. Is that what they're referring to?







share|improve this question






















  • Look like just another way of introducing "namespaces".
    – Kusalananda
    Nov 12 '17 at 17:15














up vote
5
down vote

favorite
1












The Google bash style guide mentions bash packages, where the package name should be separated from the function name by double colons




If you're writing single functions, use lowercase and separate words with underscore. If you're writing a package, separate package names with ::. Braces must be on the same line as the function name (as with other languages at Google) and no space between the function name and the parenthesis.




# Single function
my_func()
...


# Part of a package
mypackage::my_func()
...



I've googled but found no references to bash packages except for the Lightweight bash Package Manager. Is that what they're referring to?







share|improve this question






















  • Look like just another way of introducing "namespaces".
    – Kusalananda
    Nov 12 '17 at 17:15












up vote
5
down vote

favorite
1









up vote
5
down vote

favorite
1






1





The Google bash style guide mentions bash packages, where the package name should be separated from the function name by double colons




If you're writing single functions, use lowercase and separate words with underscore. If you're writing a package, separate package names with ::. Braces must be on the same line as the function name (as with other languages at Google) and no space between the function name and the parenthesis.




# Single function
my_func()
...


# Part of a package
mypackage::my_func()
...



I've googled but found no references to bash packages except for the Lightweight bash Package Manager. Is that what they're referring to?







share|improve this question














The Google bash style guide mentions bash packages, where the package name should be separated from the function name by double colons




If you're writing single functions, use lowercase and separate words with underscore. If you're writing a package, separate package names with ::. Braces must be on the same line as the function name (as with other languages at Google) and no space between the function name and the parenthesis.




# Single function
my_func()
...


# Part of a package
mypackage::my_func()
...



I've googled but found no references to bash packages except for the Lightweight bash Package Manager. Is that what they're referring to?









share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '17 at 17:13









Kusalananda

105k14207325




105k14207325










asked Nov 12 '17 at 17:04









RonJohn

471213




471213











  • Look like just another way of introducing "namespaces".
    – Kusalananda
    Nov 12 '17 at 17:15
















  • Look like just another way of introducing "namespaces".
    – Kusalananda
    Nov 12 '17 at 17:15















Look like just another way of introducing "namespaces".
– Kusalananda
Nov 12 '17 at 17:15




Look like just another way of introducing "namespaces".
– Kusalananda
Nov 12 '17 at 17:15










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










I don't think that Bash has any built-in support for packages in the way that "real" programming languages do. It's probably just a naming convention used to mimic namespaces for the purposes of code organization. See the following post for further discussion:



  • What are double colons :: in a shell script?

I imagine it was inspired by the syntax used for Perl modules.






share|improve this answer






















  • As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
    – RonJohn
    Nov 12 '17 at 17:27










  • @RonJohn Yeah, that's my take-away.
    – igal
    Nov 12 '17 at 17:29










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f404076%2fwhat-are-bash-packages%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










I don't think that Bash has any built-in support for packages in the way that "real" programming languages do. It's probably just a naming convention used to mimic namespaces for the purposes of code organization. See the following post for further discussion:



  • What are double colons :: in a shell script?

I imagine it was inspired by the syntax used for Perl modules.






share|improve this answer






















  • As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
    – RonJohn
    Nov 12 '17 at 17:27










  • @RonJohn Yeah, that's my take-away.
    – igal
    Nov 12 '17 at 17:29














up vote
3
down vote



accepted










I don't think that Bash has any built-in support for packages in the way that "real" programming languages do. It's probably just a naming convention used to mimic namespaces for the purposes of code organization. See the following post for further discussion:



  • What are double colons :: in a shell script?

I imagine it was inspired by the syntax used for Perl modules.






share|improve this answer






















  • As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
    – RonJohn
    Nov 12 '17 at 17:27










  • @RonJohn Yeah, that's my take-away.
    – igal
    Nov 12 '17 at 17:29












up vote
3
down vote



accepted







up vote
3
down vote



accepted






I don't think that Bash has any built-in support for packages in the way that "real" programming languages do. It's probably just a naming convention used to mimic namespaces for the purposes of code organization. See the following post for further discussion:



  • What are double colons :: in a shell script?

I imagine it was inspired by the syntax used for Perl modules.






share|improve this answer














I don't think that Bash has any built-in support for packages in the way that "real" programming languages do. It's probably just a naming convention used to mimic namespaces for the purposes of code organization. See the following post for further discussion:



  • What are double colons :: in a shell script?

I imagine it was inspired by the syntax used for Perl modules.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 '17 at 17:25

























answered Nov 12 '17 at 17:19









igal

4,830930




4,830930











  • As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
    – RonJohn
    Nov 12 '17 at 17:27










  • @RonJohn Yeah, that's my take-away.
    – igal
    Nov 12 '17 at 17:29
















  • As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
    – RonJohn
    Nov 12 '17 at 17:27










  • @RonJohn Yeah, that's my take-away.
    – igal
    Nov 12 '17 at 17:29















As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
– RonJohn
Nov 12 '17 at 17:27




As if you put a bunch of functions in mylib.sh all being prefixed with mylib:: and then source that file at the top of your "end user" scripts. IOW, home-rolled namespaces?
– RonJohn
Nov 12 '17 at 17:27












@RonJohn Yeah, that's my take-away.
– igal
Nov 12 '17 at 17:29




@RonJohn Yeah, that's my take-away.
– igal
Nov 12 '17 at 17:29

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f404076%2fwhat-are-bash-packages%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)