LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   function (https://www.linuxquestions.org/questions/linux-newbie-8/function-176604/)

jesus_edu 05-01-2004 05:52 AM

function
 
hello!
I've just installed a program, but for running it, I must write everytime the full path...
I'd like to write a function , for example :

function program() {
/home/user/program/program
}

But every time I quit the shell, I must write the function another time :-) how can I save the function? I'm using SuSe 9.0
thanks

hfawzy 05-01-2004 06:16 AM

You can add your function to the .bashrc file located in your home directory.
Instead of writing a function, you could have created a symbolic link (using the ln command) poining to the path of the program. You would have then placed this link in a directory that belongs to the $PATH enviroment variable (ex : /usr/bin or /usr/local/bin).

Hope that helps.

jesus_edu 05-01-2004 06:36 AM

thanks for the information, that whas just what i needed ...first, i learned how to write functions that are always available, then i made the link that you told me and everything's okay ... thanks a lot


All times are GMT -5. The time now is 10:42 AM.