Find the answer to your Linux question:
Results 1 to 8 of 8
How can i make my script run that is in "mactabilis home" What is on the desktop,without doing ./<script>,I just wont it to run by simply typing the name without ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User mactabilis's Avatar
    Join Date
    Apr 2005
    Location
    moon
    Posts
    379

    Not ./


    How can i make my script run that is in "mactabilis home" What is on the desktop,without doing ./<script>,I just wont it to run by simply typing the name without the ./ I mv the script to bin to see if that would work but still when i type the name of it it cant find it ,i changed the permissions with chmod 755 and changed my path, It does run after i do export PATH=$PATH:/mactabilis/home/ .But when i got out of terminal and come back in i have to type PATH=$PATH:/mactabilis/home/ again to get it to run without ./.

  2. #2
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Edit .bashrc or .bash_profile and add your path to that.

    As for ./script, it is convention that you run it like that when you are in the directory where the script is. For scripts or programs in other directories, you can just type the name without the ./. Surely the ./ convention is there for a reason (as about anything in Linux ).
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  3. #3
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    Add . to your path. This will make anything in your current directory searched in your path, so that you dont need to type ./ .

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User mactabilis's Avatar
    Join Date
    Apr 2005
    Location
    moon
    Posts
    379

    Not ./

    Like i said i have eddited the .bash_profile and i still cant run it from other dir ,I see your point
    What is correct,But i'm not sure how i would eddit the .bashrc for this, ive only ever put simple things in there like rm='rm -i' .

  6. #5
    Linux User mactabilis's Avatar
    Join Date
    Apr 2005
    Location
    moon
    Posts
    379

    Not ./

    Ok thanks that has done the job nicely i can run 'my script' from any directory without doing ./ ,But when i run a alias command i have to ,source .bash_profile for them to work each time i go back in to the Terminal.

  7. #6
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    hmm, you might want to try and put source ~/.bash_profile in your ~/.bashrc
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  8. #7
    Linux User mactabilis's Avatar
    Join Date
    Apr 2005
    Location
    moon
    Posts
    379

    Not ./

    No go there,so I moved them over to .bashrc ,but still even there i have to type source .bashrc
    to activate my alias commands each time i start Terminal.

  9. #8
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    hmm, do you have this line in your .bash_profile:
    [ -f ~/.bashrc ] && . ~/.bashrc
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •