rizzler Posted October 22, 2008 Share Posted October 22, 2008 hello i have a script called "max.sh" with tars up the files of the user, now when im logged in as "max" i would like this script to be executed everytime i type "tar_files" or someting like that and it should not mather where on the computer i am at the moment. i understood i have to edit /home/max/.bash_profile to be able to achive this, but what to i write here to get this to work? i use latest debian by the way. Quote Link to comment https://forums.phpfreaks.com/topic/129539-need-help-with-path/ Share on other sites More sharing options...
trq Posted October 22, 2008 Share Posted October 22, 2008 The easiest thing to do would be to rename the file to tar_files and place it within a directory called bin within max's home. This directory is already within your path. If you don't wish to create said directory, you'll need to add whatever directory the script is within to your $PATH variable. This is done by placing the following line within ~/.bashrc PATH="${PATH}:/new/path/to/add"; export PATH Using the above you would still need to rename the file to tar_files. One last method would be to simply create an alias. Again, within ~/.bashrc alias tar_files='/full/path/to/max.sh' After making any changes to ~/.bashrc you need to source it for the changes to take effect. . ~/.bashrc Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/129539-need-help-with-path/#findComment-671688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.