The files with the extension bash and sh












3















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.










share|improve this question























  • 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
















3















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.










share|improve this question























  • 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














3












3








3








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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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



















  • 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










1 Answer
1






active

oldest

votes


















8














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.






share|improve this answer

























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    8














    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.






    share|improve this answer






























      8














      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.






      share|improve this answer




























        8












        8








        8







        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.






        share|improve this answer















        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 1 hour ago

























        answered 1 hour ago









        DopeGhotiDopeGhoti

        44.1k55582




        44.1k55582






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python