LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-03-2013, 08:07 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
A question about the /usr/local/bin/


I put a script test.sh under /usr/local/bin/.

Then I loggin as a normal user. As I try to run this script with

Code:
test.sh
I got error test.sh: command not found


In RHEL it works.

What could be the problem?
 
Old 07-03-2013, 08:10 AM   #2
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
Did you make it executable? Check with "ls -al /usr/local/bin/test.sh". If it's not executable, make it so with "chmod +x /usr/local/bin/test.sh".

Is /usr/local/bin in your path? Check with "echo $PATH".
 
1 members found this post helpful.
Old 07-03-2013, 08:53 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
You're getting this error because /usr/local/bin/ is possibly not available in your PATH variable. Just check it using:
Code:
~$ echo $PATH
If it's not listed, then add it to the PATH, using cmd:
Code:
~$ export PATH=$PATH:/usr/local/bin/
 
1 members found this post helpful.
Old 07-03-2013, 09:28 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
or run by full path. or when in the directory with ./test.sh. ./ for the working directory.
 
  


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
difference between /usr/local/bin & /usr/bin cgirishaanekal Linux - Newbie 2 07-19-2012 02:18 AM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 02:59 PM
[SOLVED] Kickoff Application Launches from /usr/bin rather than /usr/local/bin Tim Johnson Slackware 2 05-26-2010 09:36 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 08:12 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