vi editor
$ store
Which file do you want to store: demo Do you want to delete file demo in its current location? [y/n]: y You can always retrieve the file with 'getback' later. Good Bye $ How do I write a program that starts with entering the program's name instead of having to enter ./(DotSlash) at the beginning. The example of the output of the program is as stated above. A little help please :-) |
Add it to a bin directory or add script's location to path.
|
Quote:
|
Quote:
To get your program to run "without giving path", you either put it into a directory that is automatically searched (see directories listed in $PATH), or add the directory, where the executable is, to the list yourself. Note: while it may be possible to have the system search for the current working directory first, meaning that you could execute any file within the current directory without typing the dot-slash, it might not be wise; this would make it a lot easier to accidentally run a program, which you usually do not want to do. |
If you're using Bash and your program is in /home/user/bin, add the following line to your .bashrc:
export PATH=$PATH:/home/user/bin This appends the directory "/home/user/bin" to the list in the variable $PATH. Also, your question has nothing to do with vi. In future, please try to use titles that are descriptive of your question/problem. |
All times are GMT -5. The time now is 09:23 PM. |