evan Posted March 10, 2004 Share Posted March 10, 2004 Hi, I did the "chmod +x filename" thing before I run this executable file, but all I got is "bush: filename: command not found" Why? Do I have edit some other files to achieve this or just simply I did it wrong? thank you. Link to comment Share on other sites More sharing options...
CaKeY Posted March 10, 2004 Share Posted March 10, 2004 What program are you trying to run? A little more info would be helpful. Link to comment Share on other sites More sharing options...
HellBender Posted March 10, 2004 Share Posted March 10, 2004 Try: ./bush Link to comment Share on other sites More sharing options...
evan Posted March 10, 2004 Author Share Posted March 10, 2004 What program are you trying to run? A little more info would be helpful. It's a script file written by other people, and is used to run some sorts of java programs. Link to comment Share on other sites More sharing options...
evan Posted March 10, 2004 Author Share Posted March 10, 2004 Try:./bush ./bush? I ran it, but not good: "bash: ./bush: No such file or directory thank you. Link to comment Share on other sites More sharing options...
HellBender Posted March 10, 2004 Share Posted March 10, 2004 OH, so up there in your first post it wasnt "bush: filename" it was "bash: filename" :laugh: well, try: ./filename and replace filename with the name of the executable you're trying to run. It could be becasue you dont have .; in your path. Link to comment Share on other sites More sharing options...
evan Posted March 10, 2004 Author Share Posted March 10, 2004 OH, so up there in your first post it wasnt "bush: filename" it was "bash: filename":laugh: well, try: ./filename and replace filename with the name of the executable you're trying to run. It could be becasue you dont have .; in your path. oh, sorry about that stupid typing mistake :blush: yeah, I tried "./filename" format, but it seemed it only worked with the executable file without command line. however, the one Im trying to get it work is based on command line input (e.g. filename -x) so it didn't work in that way, unfortunately. em .... you just mentioned I don't have .; in my path, what's that? I suppose it would be helpful to my problem?! thank you. Link to comment Share on other sites More sharing options...
kjordan2001 Posted March 10, 2004 Share Posted March 10, 2004 Well, . in your path makes the current directory in your path basically so you don't have to put ./ on it to run it. ./filename -x should work though. Link to comment Share on other sites More sharing options...
chavo Posted March 10, 2004 Share Posted March 10, 2004 If you want to put it in your path just make a directory named bin in your home directory. Then move the file there. Most distros put ~/bin in to $PATH. Then you can run the file from anywhere. If ~/bin isn't in your path, I'll tell how to add it. Link to comment Share on other sites More sharing options...
evan Posted March 10, 2004 Author Share Posted March 10, 2004 Well, . in your path makes the current directory in your path basically so you don't have to put ./ on it to run it. ./filename -x should work though. I tried, but it says this time: "bash: /directory.../filename: /usr/local/bin/bash: bad interpreter: No such file or directory" but the file without command argument works. thank you. Link to comment Share on other sites More sharing options...
evan Posted March 10, 2004 Author Share Posted March 10, 2004 If you want to put it in your path just make a directory named bin in your home directory. Then move the file there. Most distros put ~/bin in to $PATH. Then you can run the file from anywhere. If ~/bin isn't in your path, I'll tell how to add it. thanks, I will try and let you know what happen then. Link to comment Share on other sites More sharing options...
HellBender Posted March 11, 2004 Share Posted March 11, 2004 run this command: export PATH=$PATH;.; That'll add your current directory to the path. Link to comment Share on other sites More sharing options...
evan Posted March 11, 2004 Author Share Posted March 11, 2004 If you want to put it in your path just make a directory named bin in your home directory. Then move the file there. Most distros put ~/bin in to $PATH. Then you can run the file from anywhere. If ~/bin isn't in your path, I'll tell how to add it. nah, it works for the files with no command argument, but still not works with the command line argument file. it says: "bash: /directory.../bin/filename: /usr/local/bin/bash: bad interpreter: No such file or directory" Another thing perhaps deserved to be mentioned is the file I cannot get it work is a shell script. thank you. Link to comment Share on other sites More sharing options...
the evn show Posted March 11, 2004 Share Posted March 11, 2004 This is a shell script right? EDIT: Yup, sorry - didn't read your post carefully enough. if so try "whereis bash" to find out the location of bash. then change the first line from "#!/usr/local/bin/bash" to "#!/bin/bash" or whatever the location of bash is. example: (evn@evnbook:evn)$ ./script.sh -bash: ./script.sh: /usr/local/bin/bash: bad interpreter: No such file or directory (evn@evnbook:evn)$ whereis bash /bin/bash (evn@evnbook:evn)$ cat script.sh #!/usr/local/bin/bash echo "script works" (evn@evnbook:evn)$ emacs script.sh (evn@evnbook:evn)$ cat script.sh #!/bin/bash echo "script works" (evn@evnbook:evn)$ ./script.sh script works (evn@evnbook:evn)$ Link to comment Share on other sites More sharing options...
MrStaticVoid Posted March 11, 2004 Share Posted March 11, 2004 run this command:export PATH=$PATH;.; That'll add your current directory to the path. GAH! : are path separators. ; is for Windows. Link to comment Share on other sites More sharing options...
HellBender Posted March 11, 2004 Share Posted March 11, 2004 GAH! : are path separators. ; is for Windows. :pinch: :pinch: :pinch: I tell you, I edited that line back and fourth about five times between : and ; before finally deciding to leave it at ;.. Sorry :laugh: Link to comment Share on other sites More sharing options...
kemical Posted March 11, 2004 Share Posted March 11, 2004 This is a shell script right?EDIT: Yup, sorry - didn't read your post carefully enough. if so try "whereis bash" to find out the location of bash. then change the first line from "#!/usr/local/bin/bash" to "#!/bin/bash" or whatever the location of bash is. example: (evn@evnbook:evn)$ ./script.sh -bash: ./script.sh: /usr/local/bin/bash: bad interpreter: No such file or directory (evn@evnbook:evn)$ whereis bash /bin/bash (evn@evnbook:evn)$ cat script.sh #!/usr/local/bin/bash echo "script works" (evn@evnbook:evn)$ emacs script.sh (evn@evnbook:evn)$ cat script.sh #!/bin/bash echo "script works" (evn@evnbook:evn)$ ./script.sh script works (evn@evnbook:evn)$ i believe this to be your fix here Link to comment Share on other sites More sharing options...
Recommended Posts