What are bash packages?

Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
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?
bash shell-script shell
add a comment |Â
up vote
5
down vote
favorite
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?
bash shell-script shell
Look like just another way of introducing "namespaces".
â Kusalananda
Nov 12 '17 at 17:15
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
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?
bash shell-script shell
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?
bash shell-script shell
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
add a comment |Â
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
add a comment |Â
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.
As if you put a bunch of functions inmylib.shall being prefixed withmylib::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
add a comment |Â
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.
As if you put a bunch of functions inmylib.shall being prefixed withmylib::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
add a comment |Â
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.
As if you put a bunch of functions inmylib.shall being prefixed withmylib::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
add a comment |Â
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.
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.
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 inmylib.shall being prefixed withmylib::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
add a comment |Â
As if you put a bunch of functions inmylib.shall being prefixed withmylib::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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Look like just another way of introducing "namespaces".
â Kusalananda
Nov 12 '17 at 17:15