Not able to execute script using sh

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











up vote
1
down vote

favorite
2












I am Not able to execute script using sh file_name
But it's working fine with command : ./filename



Rgrds
Aditya










share|improve this question







New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    sh file_name won''t work if the name of the file is filename not file_name.
    – karel
    31 mins ago











  • Use sh ./filename instead of sh file_name
    – WinEunuuchs2Unix
    30 mins ago










  • What do you mean by "not able to execute"? What message do you get?
    – PerlDuck
    9 mins ago














up vote
1
down vote

favorite
2












I am Not able to execute script using sh file_name
But it's working fine with command : ./filename



Rgrds
Aditya










share|improve this question







New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    sh file_name won''t work if the name of the file is filename not file_name.
    – karel
    31 mins ago











  • Use sh ./filename instead of sh file_name
    – WinEunuuchs2Unix
    30 mins ago










  • What do you mean by "not able to execute"? What message do you get?
    – PerlDuck
    9 mins ago












up vote
1
down vote

favorite
2









up vote
1
down vote

favorite
2






2





I am Not able to execute script using sh file_name
But it's working fine with command : ./filename



Rgrds
Aditya










share|improve this question







New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am Not able to execute script using sh file_name
But it's working fine with command : ./filename



Rgrds
Aditya







scripts sh






share|improve this question







New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 34 mins ago









user3748987

61




61




New contributor




user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user3748987 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    sh file_name won''t work if the name of the file is filename not file_name.
    – karel
    31 mins ago











  • Use sh ./filename instead of sh file_name
    – WinEunuuchs2Unix
    30 mins ago










  • What do you mean by "not able to execute"? What message do you get?
    – PerlDuck
    9 mins ago












  • 1




    sh file_name won''t work if the name of the file is filename not file_name.
    – karel
    31 mins ago











  • Use sh ./filename instead of sh file_name
    – WinEunuuchs2Unix
    30 mins ago










  • What do you mean by "not able to execute"? What message do you get?
    – PerlDuck
    9 mins ago







1




1




sh file_name won''t work if the name of the file is filename not file_name.
– karel
31 mins ago





sh file_name won''t work if the name of the file is filename not file_name.
– karel
31 mins ago













Use sh ./filename instead of sh file_name
– WinEunuuchs2Unix
30 mins ago




Use sh ./filename instead of sh file_name
– WinEunuuchs2Unix
30 mins ago












What do you mean by "not able to execute"? What message do you get?
– PerlDuck
9 mins ago




What do you mean by "not able to execute"? What message do you get?
– PerlDuck
9 mins ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote













On Ubuntu, sh (or more accurately, /bin/sh) is "dash" and not "bash". When you use sh filename you force the script to be interpreted by dash. When you use ./filename the script is interpreted by whatever the "shebang" (#!... on first line) says, and this is normally the interpreter the script has been written for (bash, likely).






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    user3748987 is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1082236%2fnot-able-to-execute-script-using-sh-file-name%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













    On Ubuntu, sh (or more accurately, /bin/sh) is "dash" and not "bash". When you use sh filename you force the script to be interpreted by dash. When you use ./filename the script is interpreted by whatever the "shebang" (#!... on first line) says, and this is normally the interpreter the script has been written for (bash, likely).






    share|improve this answer
























      up vote
      3
      down vote













      On Ubuntu, sh (or more accurately, /bin/sh) is "dash" and not "bash". When you use sh filename you force the script to be interpreted by dash. When you use ./filename the script is interpreted by whatever the "shebang" (#!... on first line) says, and this is normally the interpreter the script has been written for (bash, likely).






      share|improve this answer






















        up vote
        3
        down vote










        up vote
        3
        down vote









        On Ubuntu, sh (or more accurately, /bin/sh) is "dash" and not "bash". When you use sh filename you force the script to be interpreted by dash. When you use ./filename the script is interpreted by whatever the "shebang" (#!... on first line) says, and this is normally the interpreter the script has been written for (bash, likely).






        share|improve this answer












        On Ubuntu, sh (or more accurately, /bin/sh) is "dash" and not "bash". When you use sh filename you force the script to be interpreted by dash. When you use ./filename the script is interpreted by whatever the "shebang" (#!... on first line) says, and this is normally the interpreter the script has been written for (bash, likely).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 23 mins ago









        xenoid

        1,0431314




        1,0431314




















            user3748987 is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            user3748987 is a new contributor. Be nice, and check out our Code of Conduct.












            user3748987 is a new contributor. Be nice, and check out our Code of Conduct.











            user3748987 is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1082236%2fnot-able-to-execute-script-using-sh-file-name%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery