Answer the question
In order to leave comments, you need to log in
How to embed a script in bash?
I apologize for a simple question, but I can’t find something at all. How can I call a script from bash without specifying the path to the script?
For example, there is a script in /home/user/script.exp
at the moment it can only be called through ./script.exp or /home/user/script.exp, but I would like to be able to call it from anywhere simply by user @server:~$ script
Answer the question
In order to leave comments, you need to log in
Either add /home/user/ to your PATH variable, or copy the script to one of the folders already in your PATH variable.
Usually, they do not put their scripts in the root of the home folder, but create a bin directory there (/home/[username]/bin), and various scripts are put there. and add this directory to PATH.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question