LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2005, 04:54 PM   #1
anticuchos
Member
 
Registered: Sep 2005
Posts: 52

Rep: Reputation: 15
Bash scripts not working


Code:
anticuchos@linux:~/bin> getit.sh
bash: getit.sh: command not found
Execute is enabled. Why won't it respond?
 
Old 09-24-2005, 05:00 PM   #2
Stan the caddy
Member
 
Registered: Dec 2003
Location: Victoria, B.C
Distribution: Slackware
Posts: 61

Rep: Reputation: 15
You don't have your current working directory in your PATH shell variable. Either call the script like this
Code:
./getit.sh
or add "." to your PATH
 
Old 09-24-2005, 10:01 PM   #3
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
Adding the current working directory to your PATH is not a good idea for security reasons, particularly for the root user.

If you want to, add the following line to ~/.bashrc:
Code:
export PATH=$PATH:.
I hope this helps
--Ian
 
Old 09-25-2005, 04:58 PM   #4
anticuchos
Member
 
Registered: Sep 2005
Posts: 52

Original Poster
Rep: Reputation: 15
What does this little thing do?: export PATH=$PATH:
 
Old 09-25-2005, 05:12 PM   #5
asmo
LQ Newbie
 
Registered: Sep 2005
Location: FRANCE - Paris
Distribution: Debian Unstable
Posts: 3

Rep: Reputation: 0
Code:
sh getit.sh
or

Code:
chmod 700 getit.sh
./getit.sh
 
Old 09-25-2005, 09:40 PM   #6
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
Quote:
Originally posted by anticuchos
What does this little thing do?: export PATH=$PATH:
Linux has a list of directories that it searches whenever you want to execute a command. This is your PATH.

Your path consists of directories such as /bin, /usr/bin and some others. If you want to run a command in your current directory (.) you need to add it to your path. The above line is how to do that. $PATH is an environment variable, and this is just the syntax for setting it. You add it to ~/.bashrc, so that it is set each time you log in.

I hope this helps
--Ian
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
little help with bash scripts sniff Programming 2 10-26-2005 05:17 PM
bash scripts hoffmanyew Programming 3 08-11-2005 01:27 AM
Bash Scripts Skute Programming 7 03-12-2004 10:17 AM
$? in Bash scripts clinton Linux - Newbie 4 02-20-2004 11:15 AM
Bash scripts? BajaNick Programming 3 07-05-2003 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration