I have a working shell script that I would like to add as a command mein-befehl referring to that post:

echo "$result_string"

so I have created the bin directory with

mkdir ~/bin

and placed my script file inside there. Then I have made it executable:

chmod +x ~/bin/mein-befehl

After that I have exportet the path:

export PATH=$PATH:~/bin

Updating by

sudo ~/.bashrc

returns the following issue to me:

sudo: /home/martin/.bashrc: command not found



is accepted.

So when I restart the terminal and type

mein-befehl "2016"

returns a command not found issue.

Question: I have followed exactly the steps mentioned in the post. Other sources online point out similiar things. What can I still have done wrong?

my $PATH variable contains:

  • 4
    export PATH=$PATH:~/bin doesn't add to your PATH persistently unless you add it to your ~/.bashrc file. Also, your sudo ./bashrc step should probably have been source ~/.bashrc or . ~/.bashrc – steeldriver Apr 27 '17 at 12:00
  • running 'source ~/.bashrc' made it. I have read somewhere in the linked post that running '~/.profile' should be enough. Can you explain the difference, please? – jublikon Apr 27 '17 at 12:03
  • @steeldriver Enough for an answer, isn’t it? – Melebius Apr 27 '17 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.