How can I make an alias that has an executable's name The 2019 Stack Overflow Developer Survey...

Working through the single responsibility principle (SRP) in Python when calls are expensive

Word to describe a time interval

Is an up-to-date browser secure on an out-of-date OS?

Was credit for the black hole image misappropriated?

How do you keep chess fun when your opponent constantly beats you?

Would an alien lifeform be able to achieve space travel if lacking in vision?

What do I do when my TA workload is more than expected?

How did passengers keep warm on sail ships?

Am I ethically obligated to go into work on an off day if the reason is sudden?

Make it rain characters

What aspect of planet Earth must be changed to prevent the industrial revolution?

Are spiders unable to hurt humans, especially very small spiders?

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

Why can't devices on different VLANs, but on the same subnet, communicate?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Did the new image of black hole confirm the general theory of relativity?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Do working physicists consider Newtonian mechanics to be "falsified"?

Is there a writing software that you can sort scenes like slides in PowerPoint?

What's the point in a preamp?

Can a flute soloist sit?

Does Parliament hold absolute power in the UK?

Can I visit the Trinity College (Cambridge) library and see some of their rare books



How can I make an alias that has an executable's name



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election ResultsHow can I `alias sudo !!`?Alias for finding a file not working in bashHow to make the zsh “correct” functionality remember my spell-correction decisionsHow to alias rm to always confirmHow to make alias trailing with space hack works with parameter suppliedHow can bash aliases be configured to handle spaces in directory names?Insert alias in sudoers fileHow do I make a working emacs alias function?How can I alias a history expansion in zsh?How to create alias with a command contains ' and "





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







-1















I tried to implement the following line in my .bashrc,



alias ./my_exec='printf "foo"'


However, the alias doesn't work, and the following line appears :



bash: alias: `./my_exec': invalid alias name


I know that the zsh terminal can make this work, but I wouldn't switch to it for this only thing.



Is there is a way I can make this alias work ?










share|improve this question







New contributor




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
















  • 2





    You need to use a valid name, such as: alias my_exec='printf "foo"'. Or, is there some reason that you want the ./ as part of the alias name?

    – John1024
    5 hours ago













  • Yes, the ./ is necessary to me

    – HeyShafty
    4 hours ago











  • And, the reason for that is? If you want people here to provide useful help, it would help if you explained why you want to do this.

    – John1024
    4 hours ago








  • 1





    Prank a friend, so that his ./my_exec outputs "Segmentation fault (Core dumped)" I have zsh, so he could prank me by doing it, I just want payback

    – HeyShafty
    4 hours ago













  • @HeyShafty "Prank a friend". You need to think of better excuses when asking questions on SE.

    – RonJohn
    4 hours ago


















-1















I tried to implement the following line in my .bashrc,



alias ./my_exec='printf "foo"'


However, the alias doesn't work, and the following line appears :



bash: alias: `./my_exec': invalid alias name


I know that the zsh terminal can make this work, but I wouldn't switch to it for this only thing.



Is there is a way I can make this alias work ?










share|improve this question







New contributor




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
















  • 2





    You need to use a valid name, such as: alias my_exec='printf "foo"'. Or, is there some reason that you want the ./ as part of the alias name?

    – John1024
    5 hours ago













  • Yes, the ./ is necessary to me

    – HeyShafty
    4 hours ago











  • And, the reason for that is? If you want people here to provide useful help, it would help if you explained why you want to do this.

    – John1024
    4 hours ago








  • 1





    Prank a friend, so that his ./my_exec outputs "Segmentation fault (Core dumped)" I have zsh, so he could prank me by doing it, I just want payback

    – HeyShafty
    4 hours ago













  • @HeyShafty "Prank a friend". You need to think of better excuses when asking questions on SE.

    – RonJohn
    4 hours ago














-1












-1








-1








I tried to implement the following line in my .bashrc,



alias ./my_exec='printf "foo"'


However, the alias doesn't work, and the following line appears :



bash: alias: `./my_exec': invalid alias name


I know that the zsh terminal can make this work, but I wouldn't switch to it for this only thing.



Is there is a way I can make this alias work ?










share|improve this question







New contributor




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












I tried to implement the following line in my .bashrc,



alias ./my_exec='printf "foo"'


However, the alias doesn't work, and the following line appears :



bash: alias: `./my_exec': invalid alias name


I know that the zsh terminal can make this work, but I wouldn't switch to it for this only thing.



Is there is a way I can make this alias work ?







bash alias






share|improve this question







New contributor




HeyShafty 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




HeyShafty 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




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









asked 5 hours ago









HeyShaftyHeyShafty

113




113




New contributor




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





New contributor





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






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








  • 2





    You need to use a valid name, such as: alias my_exec='printf "foo"'. Or, is there some reason that you want the ./ as part of the alias name?

    – John1024
    5 hours ago













  • Yes, the ./ is necessary to me

    – HeyShafty
    4 hours ago











  • And, the reason for that is? If you want people here to provide useful help, it would help if you explained why you want to do this.

    – John1024
    4 hours ago








  • 1





    Prank a friend, so that his ./my_exec outputs "Segmentation fault (Core dumped)" I have zsh, so he could prank me by doing it, I just want payback

    – HeyShafty
    4 hours ago













  • @HeyShafty "Prank a friend". You need to think of better excuses when asking questions on SE.

    – RonJohn
    4 hours ago














  • 2





    You need to use a valid name, such as: alias my_exec='printf "foo"'. Or, is there some reason that you want the ./ as part of the alias name?

    – John1024
    5 hours ago













  • Yes, the ./ is necessary to me

    – HeyShafty
    4 hours ago











  • And, the reason for that is? If you want people here to provide useful help, it would help if you explained why you want to do this.

    – John1024
    4 hours ago








  • 1





    Prank a friend, so that his ./my_exec outputs "Segmentation fault (Core dumped)" I have zsh, so he could prank me by doing it, I just want payback

    – HeyShafty
    4 hours ago













  • @HeyShafty "Prank a friend". You need to think of better excuses when asking questions on SE.

    – RonJohn
    4 hours ago








2




2





You need to use a valid name, such as: alias my_exec='printf "foo"'. Or, is there some reason that you want the ./ as part of the alias name?

– John1024
5 hours ago







You need to use a valid name, such as: alias my_exec='printf "foo"'. Or, is there some reason that you want the ./ as part of the alias name?

– John1024
5 hours ago















Yes, the ./ is necessary to me

– HeyShafty
4 hours ago





Yes, the ./ is necessary to me

– HeyShafty
4 hours ago













And, the reason for that is? If you want people here to provide useful help, it would help if you explained why you want to do this.

– John1024
4 hours ago







And, the reason for that is? If you want people here to provide useful help, it would help if you explained why you want to do this.

– John1024
4 hours ago






1




1





Prank a friend, so that his ./my_exec outputs "Segmentation fault (Core dumped)" I have zsh, so he could prank me by doing it, I just want payback

– HeyShafty
4 hours ago







Prank a friend, so that his ./my_exec outputs "Segmentation fault (Core dumped)" I have zsh, so he could prank me by doing it, I just want payback

– HeyShafty
4 hours ago















@HeyShafty "Prank a friend". You need to think of better excuses when asking questions on SE.

– RonJohn
4 hours ago





@HeyShafty "Prank a friend". You need to think of better excuses when asking questions on SE.

– RonJohn
4 hours ago










3 Answers
3






active

oldest

votes


















1














maybe you need a function



my_exec(){
print "foo"
}


this found for me,



countryip(){

COUNTY="$(whois $1 | grep ountry))"
echo "$COUNTRY $1 n"

}

$ countryip 192.168.0.1





share|improve this answer








New contributor




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
















  • 1





    Wow it worked actually ``` ./my_exec() { printf "foon" } ```

    – HeyShafty
    4 hours ago













  • @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

    – mosvy
    4 hours ago



















4














$ BASH_ALIASES[./my_exec]='echo yes'
$ ./my_exec
yes


According to the bash manpage, you cannot use / in an alias name:




The characters /, $, `, and = and any of the shell metacharacters or quoting characters listed above may not appear in an alias name.




When defining an alias via the alias name=val syntax, bash will refuse any alias name that contains any character defined by the regex:



[ tn&();<>|\"'`$/]


See the legal_alias_name() function in its source code. Notice that the lack of = above is not an omission; the impossibility of using it in an alias name is simply an artifact of the syntax.



But you can use some of those characters in an alias, by defining it indirectly via the BASH_ALIASES array:



$ BASH_ALIASES['/a=$']='echo yes'; /a=$
yes


Alias names in the susv4 standard




3.10 Alias Name



In the shell command language, a word consisting solely of underscores,
digits, and alphabetics from the portable character set and any of the
following characters: !, %, ,, @.



Implementations may allow other characters within alias names as an extension.




So both bash and zsh (which allows / to be used in alias names directly) are within the standard.



Slashes and other funny chars in function names



In bash and zsh, a / can be used directly in a function name:



$ /bin/sh(){ echo no bin/sh today; }
$ /bin/sh -c ls
no bin/sh today


This is a non-standard extension; in a standard shell, a function name can contain only ascii letters, digits and underscores, and cannot start with a digit.



In bash, a function name can be made up of any characters except $, with the condition that is doesn't contain only digits and within the constraints imposed by the function definition syntax. You can look at execute_intern_function() and check_identifier() for all the details.



In zsh the all-digits constraint doesn't apply, and a function name can also be quoted/escaped in the definition:



zsh$ 666() echo "$0"; $() echo "$0"
zsh$ 666; $
666
$





share|improve this answer

































    -1















    The question here is that we are forgetting that './' says to the
    shell 'looks at this file, command is here in this directory that I am
    now "current directory" and here in this case it is not necessary
    your presence because as we are seeing will occur a clear mistake! in
    case you should declare the alias normally just like any other alias





    • alias my_exec = 'echo "foo "'here you will get a better result. OK!







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


      }
      });






      HeyShafty 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%2funix.stackexchange.com%2fquestions%2f512191%2fhow-can-i-make-an-alias-that-has-an-executables-name%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      maybe you need a function



      my_exec(){
      print "foo"
      }


      this found for me,



      countryip(){

      COUNTY="$(whois $1 | grep ountry))"
      echo "$COUNTRY $1 n"

      }

      $ countryip 192.168.0.1





      share|improve this answer








      New contributor




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
















      • 1





        Wow it worked actually ``` ./my_exec() { printf "foon" } ```

        – HeyShafty
        4 hours ago













      • @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

        – mosvy
        4 hours ago
















      1














      maybe you need a function



      my_exec(){
      print "foo"
      }


      this found for me,



      countryip(){

      COUNTY="$(whois $1 | grep ountry))"
      echo "$COUNTRY $1 n"

      }

      $ countryip 192.168.0.1





      share|improve this answer








      New contributor




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
















      • 1





        Wow it worked actually ``` ./my_exec() { printf "foon" } ```

        – HeyShafty
        4 hours ago













      • @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

        – mosvy
        4 hours ago














      1












      1








      1







      maybe you need a function



      my_exec(){
      print "foo"
      }


      this found for me,



      countryip(){

      COUNTY="$(whois $1 | grep ountry))"
      echo "$COUNTRY $1 n"

      }

      $ countryip 192.168.0.1





      share|improve this answer








      New contributor




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










      maybe you need a function



      my_exec(){
      print "foo"
      }


      this found for me,



      countryip(){

      COUNTY="$(whois $1 | grep ountry))"
      echo "$COUNTRY $1 n"

      }

      $ countryip 192.168.0.1






      share|improve this answer








      New contributor




      Luis Enrique Gastelum 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 answer



      share|improve this answer






      New contributor




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









      answered 4 hours ago









      Luis Enrique GastelumLuis Enrique Gastelum

      261




      261




      New contributor




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





      New contributor





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






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








      • 1





        Wow it worked actually ``` ./my_exec() { printf "foon" } ```

        – HeyShafty
        4 hours ago













      • @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

        – mosvy
        4 hours ago














      • 1





        Wow it worked actually ``` ./my_exec() { printf "foon" } ```

        – HeyShafty
        4 hours ago













      • @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

        – mosvy
        4 hours ago








      1




      1





      Wow it worked actually ``` ./my_exec() { printf "foon" } ```

      – HeyShafty
      4 hours ago







      Wow it worked actually ``` ./my_exec() { printf "foon" } ```

      – HeyShafty
      4 hours ago















      @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

      – mosvy
      4 hours ago





      @HeyShafty also ../foo/bar(){ echo yeah; }; ../foo/bar I think you should make your own answer with that -- notice however that it only works in bash and zsh.

      – mosvy
      4 hours ago













      4














      $ BASH_ALIASES[./my_exec]='echo yes'
      $ ./my_exec
      yes


      According to the bash manpage, you cannot use / in an alias name:




      The characters /, $, `, and = and any of the shell metacharacters or quoting characters listed above may not appear in an alias name.




      When defining an alias via the alias name=val syntax, bash will refuse any alias name that contains any character defined by the regex:



      [ tn&();<>|\"'`$/]


      See the legal_alias_name() function in its source code. Notice that the lack of = above is not an omission; the impossibility of using it in an alias name is simply an artifact of the syntax.



      But you can use some of those characters in an alias, by defining it indirectly via the BASH_ALIASES array:



      $ BASH_ALIASES['/a=$']='echo yes'; /a=$
      yes


      Alias names in the susv4 standard




      3.10 Alias Name



      In the shell command language, a word consisting solely of underscores,
      digits, and alphabetics from the portable character set and any of the
      following characters: !, %, ,, @.



      Implementations may allow other characters within alias names as an extension.




      So both bash and zsh (which allows / to be used in alias names directly) are within the standard.



      Slashes and other funny chars in function names



      In bash and zsh, a / can be used directly in a function name:



      $ /bin/sh(){ echo no bin/sh today; }
      $ /bin/sh -c ls
      no bin/sh today


      This is a non-standard extension; in a standard shell, a function name can contain only ascii letters, digits and underscores, and cannot start with a digit.



      In bash, a function name can be made up of any characters except $, with the condition that is doesn't contain only digits and within the constraints imposed by the function definition syntax. You can look at execute_intern_function() and check_identifier() for all the details.



      In zsh the all-digits constraint doesn't apply, and a function name can also be quoted/escaped in the definition:



      zsh$ 666() echo "$0"; $() echo "$0"
      zsh$ 666; $
      666
      $





      share|improve this answer






























        4














        $ BASH_ALIASES[./my_exec]='echo yes'
        $ ./my_exec
        yes


        According to the bash manpage, you cannot use / in an alias name:




        The characters /, $, `, and = and any of the shell metacharacters or quoting characters listed above may not appear in an alias name.




        When defining an alias via the alias name=val syntax, bash will refuse any alias name that contains any character defined by the regex:



        [ tn&();<>|\"'`$/]


        See the legal_alias_name() function in its source code. Notice that the lack of = above is not an omission; the impossibility of using it in an alias name is simply an artifact of the syntax.



        But you can use some of those characters in an alias, by defining it indirectly via the BASH_ALIASES array:



        $ BASH_ALIASES['/a=$']='echo yes'; /a=$
        yes


        Alias names in the susv4 standard




        3.10 Alias Name



        In the shell command language, a word consisting solely of underscores,
        digits, and alphabetics from the portable character set and any of the
        following characters: !, %, ,, @.



        Implementations may allow other characters within alias names as an extension.




        So both bash and zsh (which allows / to be used in alias names directly) are within the standard.



        Slashes and other funny chars in function names



        In bash and zsh, a / can be used directly in a function name:



        $ /bin/sh(){ echo no bin/sh today; }
        $ /bin/sh -c ls
        no bin/sh today


        This is a non-standard extension; in a standard shell, a function name can contain only ascii letters, digits and underscores, and cannot start with a digit.



        In bash, a function name can be made up of any characters except $, with the condition that is doesn't contain only digits and within the constraints imposed by the function definition syntax. You can look at execute_intern_function() and check_identifier() for all the details.



        In zsh the all-digits constraint doesn't apply, and a function name can also be quoted/escaped in the definition:



        zsh$ 666() echo "$0"; $() echo "$0"
        zsh$ 666; $
        666
        $





        share|improve this answer




























          4












          4








          4







          $ BASH_ALIASES[./my_exec]='echo yes'
          $ ./my_exec
          yes


          According to the bash manpage, you cannot use / in an alias name:




          The characters /, $, `, and = and any of the shell metacharacters or quoting characters listed above may not appear in an alias name.




          When defining an alias via the alias name=val syntax, bash will refuse any alias name that contains any character defined by the regex:



          [ tn&();<>|\"'`$/]


          See the legal_alias_name() function in its source code. Notice that the lack of = above is not an omission; the impossibility of using it in an alias name is simply an artifact of the syntax.



          But you can use some of those characters in an alias, by defining it indirectly via the BASH_ALIASES array:



          $ BASH_ALIASES['/a=$']='echo yes'; /a=$
          yes


          Alias names in the susv4 standard




          3.10 Alias Name



          In the shell command language, a word consisting solely of underscores,
          digits, and alphabetics from the portable character set and any of the
          following characters: !, %, ,, @.



          Implementations may allow other characters within alias names as an extension.




          So both bash and zsh (which allows / to be used in alias names directly) are within the standard.



          Slashes and other funny chars in function names



          In bash and zsh, a / can be used directly in a function name:



          $ /bin/sh(){ echo no bin/sh today; }
          $ /bin/sh -c ls
          no bin/sh today


          This is a non-standard extension; in a standard shell, a function name can contain only ascii letters, digits and underscores, and cannot start with a digit.



          In bash, a function name can be made up of any characters except $, with the condition that is doesn't contain only digits and within the constraints imposed by the function definition syntax. You can look at execute_intern_function() and check_identifier() for all the details.



          In zsh the all-digits constraint doesn't apply, and a function name can also be quoted/escaped in the definition:



          zsh$ 666() echo "$0"; $() echo "$0"
          zsh$ 666; $
          666
          $





          share|improve this answer















          $ BASH_ALIASES[./my_exec]='echo yes'
          $ ./my_exec
          yes


          According to the bash manpage, you cannot use / in an alias name:




          The characters /, $, `, and = and any of the shell metacharacters or quoting characters listed above may not appear in an alias name.




          When defining an alias via the alias name=val syntax, bash will refuse any alias name that contains any character defined by the regex:



          [ tn&();<>|\"'`$/]


          See the legal_alias_name() function in its source code. Notice that the lack of = above is not an omission; the impossibility of using it in an alias name is simply an artifact of the syntax.



          But you can use some of those characters in an alias, by defining it indirectly via the BASH_ALIASES array:



          $ BASH_ALIASES['/a=$']='echo yes'; /a=$
          yes


          Alias names in the susv4 standard




          3.10 Alias Name



          In the shell command language, a word consisting solely of underscores,
          digits, and alphabetics from the portable character set and any of the
          following characters: !, %, ,, @.



          Implementations may allow other characters within alias names as an extension.




          So both bash and zsh (which allows / to be used in alias names directly) are within the standard.



          Slashes and other funny chars in function names



          In bash and zsh, a / can be used directly in a function name:



          $ /bin/sh(){ echo no bin/sh today; }
          $ /bin/sh -c ls
          no bin/sh today


          This is a non-standard extension; in a standard shell, a function name can contain only ascii letters, digits and underscores, and cannot start with a digit.



          In bash, a function name can be made up of any characters except $, with the condition that is doesn't contain only digits and within the constraints imposed by the function definition syntax. You can look at execute_intern_function() and check_identifier() for all the details.



          In zsh the all-digits constraint doesn't apply, and a function name can also be quoted/escaped in the definition:



          zsh$ 666() echo "$0"; $() echo "$0"
          zsh$ 666; $
          666
          $






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 5 mins ago

























          answered 5 hours ago









          mosvymosvy

          9,94211236




          9,94211236























              -1















              The question here is that we are forgetting that './' says to the
              shell 'looks at this file, command is here in this directory that I am
              now "current directory" and here in this case it is not necessary
              your presence because as we are seeing will occur a clear mistake! in
              case you should declare the alias normally just like any other alias





              • alias my_exec = 'echo "foo "'here you will get a better result. OK!







              share|improve this answer




























                -1















                The question here is that we are forgetting that './' says to the
                shell 'looks at this file, command is here in this directory that I am
                now "current directory" and here in this case it is not necessary
                your presence because as we are seeing will occur a clear mistake! in
                case you should declare the alias normally just like any other alias





                • alias my_exec = 'echo "foo "'here you will get a better result. OK!







                share|improve this answer


























                  -1












                  -1








                  -1








                  The question here is that we are forgetting that './' says to the
                  shell 'looks at this file, command is here in this directory that I am
                  now "current directory" and here in this case it is not necessary
                  your presence because as we are seeing will occur a clear mistake! in
                  case you should declare the alias normally just like any other alias





                  • alias my_exec = 'echo "foo "'here you will get a better result. OK!







                  share|improve this answer














                  The question here is that we are forgetting that './' says to the
                  shell 'looks at this file, command is here in this directory that I am
                  now "current directory" and here in this case it is not necessary
                  your presence because as we are seeing will occur a clear mistake! in
                  case you should declare the alias normally just like any other alias





                  • alias my_exec = 'echo "foo "'here you will get a better result. OK!








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 hours ago









                  Joke Sr. OKJoke Sr. OK

                  6191510




                  6191510






















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










                      draft saved

                      draft discarded


















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













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












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
















                      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%2f512191%2fhow-can-i-make-an-alias-that-has-an-executables-name%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

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m