The files with the extension bash and sh
I made some researches about the files with bash
and sh
extensions. Most of the people and resources say that if a file has bash
extension, then it contains bash
scripts. Likewise, the file with sh
extensions contains sh
scripts.
However, I cannot find the differences between bash and sh scripting. There are some courses and articles which aim to teach the people to write scripts on shell, and all of them has the title shell scripting
.
In this point, which one does shell scripting correspond to ?
Bash Scripting or Sh scripting.
What I try to understand is what is the difference between bash and sh scripting.
bash shell-script shell
add a comment |
I made some researches about the files with bash
and sh
extensions. Most of the people and resources say that if a file has bash
extension, then it contains bash
scripts. Likewise, the file with sh
extensions contains sh
scripts.
However, I cannot find the differences between bash and sh scripting. There are some courses and articles which aim to teach the people to write scripts on shell, and all of them has the title shell scripting
.
In this point, which one does shell scripting correspond to ?
Bash Scripting or Sh scripting.
What I try to understand is what is the difference between bash and sh scripting.
bash shell-script shell
Related: unix.stackexchange.com/questions/9997/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/48786/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/145522/…
– Christopher
1 hour ago
add a comment |
I made some researches about the files with bash
and sh
extensions. Most of the people and resources say that if a file has bash
extension, then it contains bash
scripts. Likewise, the file with sh
extensions contains sh
scripts.
However, I cannot find the differences between bash and sh scripting. There are some courses and articles which aim to teach the people to write scripts on shell, and all of them has the title shell scripting
.
In this point, which one does shell scripting correspond to ?
Bash Scripting or Sh scripting.
What I try to understand is what is the difference between bash and sh scripting.
bash shell-script shell
I made some researches about the files with bash
and sh
extensions. Most of the people and resources say that if a file has bash
extension, then it contains bash
scripts. Likewise, the file with sh
extensions contains sh
scripts.
However, I cannot find the differences between bash and sh scripting. There are some courses and articles which aim to teach the people to write scripts on shell, and all of them has the title shell scripting
.
In this point, which one does shell scripting correspond to ?
Bash Scripting or Sh scripting.
What I try to understand is what is the difference between bash and sh scripting.
bash shell-script shell
bash shell-script shell
asked 2 hours ago
GoktugGoktug
1717
1717
Related: unix.stackexchange.com/questions/9997/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/48786/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/145522/…
– Christopher
1 hour ago
add a comment |
Related: unix.stackexchange.com/questions/9997/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/48786/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/145522/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/9997/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/9997/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/48786/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/48786/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/145522/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/145522/…
– Christopher
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
File names in POSIXland don't have "extensions". A .
in a filename is no different from any other character and has no specific meaning other than those that might be attributed to them by meatbags such as ourselves.
One could hope that any file with a name ending in .bash
would be a script meant to be executed via the bash
shell, but there is no guarantee of this.
Indeed, it's quite common to give all shell scripts a suffix of .sh
no matter which interpreter is intended for their use, as the shebang line should properly specify which shell should be used to execute such a file.
sh
and bash
are two different, but related, shells; two amongst many others such as ksh
, csh
, zsh
, fish
, ash
, dash
, and yet more others.
Each shell has its own syntax, capabilities, mannerisms, and foibles; some shells are largely compatible with each other (generally any script written for sh
can also be run in bash
or many other shells), but some are not.
add a comment |
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495147%2fthe-files-with-the-extension-bash-and-sh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
File names in POSIXland don't have "extensions". A .
in a filename is no different from any other character and has no specific meaning other than those that might be attributed to them by meatbags such as ourselves.
One could hope that any file with a name ending in .bash
would be a script meant to be executed via the bash
shell, but there is no guarantee of this.
Indeed, it's quite common to give all shell scripts a suffix of .sh
no matter which interpreter is intended for their use, as the shebang line should properly specify which shell should be used to execute such a file.
sh
and bash
are two different, but related, shells; two amongst many others such as ksh
, csh
, zsh
, fish
, ash
, dash
, and yet more others.
Each shell has its own syntax, capabilities, mannerisms, and foibles; some shells are largely compatible with each other (generally any script written for sh
can also be run in bash
or many other shells), but some are not.
add a comment |
File names in POSIXland don't have "extensions". A .
in a filename is no different from any other character and has no specific meaning other than those that might be attributed to them by meatbags such as ourselves.
One could hope that any file with a name ending in .bash
would be a script meant to be executed via the bash
shell, but there is no guarantee of this.
Indeed, it's quite common to give all shell scripts a suffix of .sh
no matter which interpreter is intended for their use, as the shebang line should properly specify which shell should be used to execute such a file.
sh
and bash
are two different, but related, shells; two amongst many others such as ksh
, csh
, zsh
, fish
, ash
, dash
, and yet more others.
Each shell has its own syntax, capabilities, mannerisms, and foibles; some shells are largely compatible with each other (generally any script written for sh
can also be run in bash
or many other shells), but some are not.
add a comment |
File names in POSIXland don't have "extensions". A .
in a filename is no different from any other character and has no specific meaning other than those that might be attributed to them by meatbags such as ourselves.
One could hope that any file with a name ending in .bash
would be a script meant to be executed via the bash
shell, but there is no guarantee of this.
Indeed, it's quite common to give all shell scripts a suffix of .sh
no matter which interpreter is intended for their use, as the shebang line should properly specify which shell should be used to execute such a file.
sh
and bash
are two different, but related, shells; two amongst many others such as ksh
, csh
, zsh
, fish
, ash
, dash
, and yet more others.
Each shell has its own syntax, capabilities, mannerisms, and foibles; some shells are largely compatible with each other (generally any script written for sh
can also be run in bash
or many other shells), but some are not.
File names in POSIXland don't have "extensions". A .
in a filename is no different from any other character and has no specific meaning other than those that might be attributed to them by meatbags such as ourselves.
One could hope that any file with a name ending in .bash
would be a script meant to be executed via the bash
shell, but there is no guarantee of this.
Indeed, it's quite common to give all shell scripts a suffix of .sh
no matter which interpreter is intended for their use, as the shebang line should properly specify which shell should be used to execute such a file.
sh
and bash
are two different, but related, shells; two amongst many others such as ksh
, csh
, zsh
, fish
, ash
, dash
, and yet more others.
Each shell has its own syntax, capabilities, mannerisms, and foibles; some shells are largely compatible with each other (generally any script written for sh
can also be run in bash
or many other shells), but some are not.
edited 2 hours ago
answered 2 hours ago
DopeGhotiDopeGhoti
44.1k55582
44.1k55582
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495147%2fthe-files-with-the-extension-bash-and-sh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Related: unix.stackexchange.com/questions/9997/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/48786/…
– Christopher
1 hour ago
Related: unix.stackexchange.com/questions/145522/…
– Christopher
1 hour ago