|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
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
|
|||
|
|||
|
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?? |
|
#2
|
|||
|
|||
|
Quote:
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. |
|
#3
|
|||
|
|||
|
NO ShizukaWashi
the message: permission denied (or somethings like that) is a permission issue but command not found is a PATH issue |
|
#4
|
|||
|
|||
|
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????
|
|
#5
|
|||
|
|||
|
Quote:
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" |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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* |
|
#8
|
|||
|
|||
|
How about adding the current directory to the PATH?
The following command will do this: PATH=$PATH:. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Can not run script file. Command not found. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|