Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
2 added 3 characters in body
source | link

There are two issues with the alias

alias menu='./menuScript.sh'
  1. It requires you to be in a particular directory when you invoke the alias. If you're in a directory where menuScript.sh does not exist, the alias will fail to execute.

    It would be better if you specified the full absolute path to the menuScript.sh script when defining the alias, e.g.

    alias menu="$HOME/local/bin/menuScript.sh"
    

    or similar.

  2. As others have already said, another reason why the alias may fail is that the script is not executable, or that is have an invalid #!-line. Make sure that the script is executable with

    chmod +x menuScript.sh
    

    and that the first line in the script is

    #!/bin/bash
    

    or whatever the path is to bash (or whatever shell the script is written for) on your system.

There are two issues with the alias

alias menu='./menuScript.sh'
  1. It requires you to be in a particular directory when you invoke the alias. If you're in a directory where menuScript.sh does not exist, the alias will fail to execute.

    It would be better if you specified the full absolute path to the menuScript.sh script when defining the alias, e.g.

    alias menu="$HOME/local/bin/menuScript.sh"
    

    or similar.

  2. As others have already said, another reason why the alias may fail is that the script is not executable, or that is have an invalid #!-line. Make sure that the script is executable with

    chmod +x menuScript.sh
    

    and that the first line in the script is

    #!/bin/bash
    

    or whatever the path to bash (or whatever shell the script is written for) on your system.

There are two issues with the alias

alias menu='./menuScript.sh'
  1. It requires you to be in a particular directory when you invoke the alias. If you're in a directory where menuScript.sh does not exist, the alias will fail to execute.

    It would be better if you specified the full absolute path to the menuScript.sh script when defining the alias, e.g.

    alias menu="$HOME/local/bin/menuScript.sh"
    

    or similar.

  2. As others have already said, another reason why the alias may fail is that the script is not executable, or that is have an invalid #!-line. Make sure that the script is executable with

    chmod +x menuScript.sh
    

    and that the first line in the script is

    #!/bin/bash
    

    or whatever the path is to bash (or whatever shell the script is written for) on your system.

1
source | link

There are two issues with the alias

alias menu='./menuScript.sh'
  1. It requires you to be in a particular directory when you invoke the alias. If you're in a directory where menuScript.sh does not exist, the alias will fail to execute.

    It would be better if you specified the full absolute path to the menuScript.sh script when defining the alias, e.g.

    alias menu="$HOME/local/bin/menuScript.sh"
    

    or similar.

  2. As others have already said, another reason why the alias may fail is that the script is not executable, or that is have an invalid #!-line. Make sure that the script is executable with

    chmod +x menuScript.sh
    

    and that the first line in the script is

    #!/bin/bash
    

    or whatever the path to bash (or whatever shell the script is written for) on your system.