UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old October 24th, 2004, 12:06 AM
ninjamyst ninjamyst is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 31 ninjamyst User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 39 sec
Reputation Power: 5
Can not run script file. Command not found.

Hi,

For some reason, I can not run ANY script file on my unix account. I know the scripts are correct because my friend can run them. I have tried adding in the script's path to my PATH variable but still I get the same error everytime I try to run any script: Command not found. Any ideas??

Reply With Quote
  #2  
Old October 24th, 2004, 02:49 AM
ShizukaWashi ShizukaWashi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Central Florida, U.S.A.
Posts: 77 ShizukaWashi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 56 m 55 sec
Reputation Power: 4
Send a message via AIM to ShizukaWashi Send a message via Yahoo to ShizukaWashi
Quote:
Originally Posted by ninjamyst
Hi,

For some reason, I can not run ANY script file on my unix account. I know the scripts are correct because my friend can run them. I have tried adding in the script's path to my PATH variable but still I get the same error everytime I try to run any script: Command not found. Any ideas??


Do you have the correct file permissions for the script? If you wrote the script and saved it in your home directory or another directory that you have write access to, than you should just be able to chmod 700 the script file - giving the owner of the file and only the owner of the file read, write, and execution permissions. If the script's owner is someone other than you than you might have to change the permissions such that you have execution permissions for the script.

Reply With Quote
  #3  
Old October 24th, 2004, 04:46 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,078 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 14 h 28 m 26 sec
Reputation Power: 9
NO ShizukaWashi
the message:
permission denied
(or somethings like that) is a permission issue
but
command not found
is a PATH issue

Reply With Quote
  #4  
Old October 24th, 2004, 11:38 AM
ninjamyst ninjamyst is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 31 ninjamyst User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 39 sec
Reputation Power: 5
When I issue the command "which scriptname", it can not find the script so I know it has to do with my PATH environment. However, I am running the script with ./scriptname which should tell the shell to find the script in the current directory...so what's wrong????

Reply With Quote
  #5  
Old October 24th, 2004, 01:01 PM
ShizukaWashi ShizukaWashi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Central Florida, U.S.A.
Posts: 77 ShizukaWashi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 56 m 55 sec
Reputation Power: 4
Send a message via AIM to ShizukaWashi Send a message via Yahoo to ShizukaWashi
Quote:
Originally Posted by guggach
NO ShizukaWashi
the message:
permission denied
(or somethings like that) is a permission issue
but
command not found
is a PATH issue


That's true, sorry, my mistake. Though it is wierd since you are executing it via ./script because when I don't then I do get the command not found error.

user@localhost ~/> blah.bash
bash: blah.bash: command not found
user@localhost ~/>./blah.bash
Hello
user@localhost ~/>

Although I did some testing on my Sun account:
====================================
pegasus% ls -al *.bash
-rwx------ 1 user 25 Oct 24 03:47 test.bash
pegasus% echo $SHELL
/bin/csh
pegasus% ./test
./test: Command not found
pegasus% ./test.bash
Hello
pegasus%
====================================

Hence you are executing the file with it's extension, neh? Just asking because in the above example when I failed to specify the extension I recieved the error "Command not found"

Reply With Quote
  #6  
Old October 25th, 2004, 01:11 AM
gurdeepdua gurdeepdua is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 gurdeepdua User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
If still not solved (if you have check for proper file permission and PATH) then can you provide the ls -l and echo $PATH and your username outputs to me.

Reply With Quote
  #7  
Old November 3rd, 2004, 04:42 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,078 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 14 h 28 m 26 sec
Reputation Power: 9
how should the shell be able to expand names ?
you are using csh (i hope: on cmd-line only)
if in your .login (you also can do it in .cshrc) is: set filec
and you type: ./xxx<ESCAPE>
csh (bash copied it, ksh uses: <escape><backslash>) will expand it
when UNIQUE, else complain, in this case enter ./xxx<CTRL-D>
to get a list of all ./xxx*

Reply With Quote
  #8  
Old November 3rd, 2004, 10:39 AM
andyb1ack andyb1ack is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 60 andyb1ack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 14 sec
Reputation Power: 4
How about adding the current directory to the PATH?

The following command will do this:
PATH=$PATH:.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Can not run script file. Command not found.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway