LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   trying to execute an expect script in .bashrc (https://www.linuxquestions.org/questions/red-hat-31/trying-to-execute-an-expect-script-in-bashrc-272803/)

smaudlin 01-02-2005 01:08 AM

trying to execute an expect script in .bashrc
 
I have a script written in expect called mxx1. It resides in /home/seanm/app/mxx1. every time I want to run it I have to go to its directory and ./mxx1 to execute it. I tried editing .bashrc with alias mxx1=.//home/seanm/appl/mxx1. Obviously this doesn't work but you can see what im trying to accomplish. To be able to type mxx1 from anywhere and launch the script. .bashrc is used for aliases but can this be done in .bashrc or should I do this elsewhere and how. Thanks

nixcraft 01-02-2005 01:15 AM

Add ~/app to your path as follows

Open vi ~/.bash_profile
and add following code:

Code:

export PATH=$PATH:~/app

From next login you should able to execute any script/code stored in ~/app dir :)

smaudlin 01-02-2005 01:34 AM

Got it. Thanks so much


All times are GMT -5. The time now is 12:50 PM.