Click to See Complete Forum and Search --> : Running Executables
TaylorVcl
08-15-2002, 08:04 PM
I have been using gcc with Sun OS to compile and run programs, never with any problems. I am a little confused why I get an error on Linux from the bash shell when I try to run a.out:
bash: a.out: command not found.
I'll bet a bunch of you know exactly what I am not doing right.
mingshun
08-15-2002, 08:08 PM
Include your current path.
i.e:
./a.out
Probably in your Solaris, the current path is already included in the /etc/profile. You may like to add this statement to your ~/.bash_profile:
export PATH=$PATH:./
Run it by ". ~/.bash_profile" without the quotes. Then in future, you can just execute "a.out" already.
bwkaz
08-16-2002, 12:33 PM
Originally posted by mingshun
export PATH=$PATH:./Of course, you meant export PATH=$PATH:. -- correct? Without the trailing slash?
(Actually, now that I think about it, the trailing slash might not matter... try it with and without.)
X_console
08-16-2002, 02:00 PM
Trailing slash doesn't matter.
Niminator
08-16-2002, 02:22 PM
I put the trailing slash in there out of habit. All those trailing slashes are probably why I have tendonitis ;)
mingshun
08-16-2002, 03:09 PM
Originally posted by bwkaz
Of course, you meant export PATH=$PATH:. -- correct? Without the trailing slash?
'/' means directory. It is a convection.
i.e: Do a "ls -F" in your home directory to see it for yourself.
And I think it is better to use './' because it is easier to see than . :p
fight_ninja
12-01-2003, 03:01 AM
i was having the same problem, and while adding ./ to the program i want to run works just fine, i'm not finding my bash profile to make the shortcut. i'm using suse pro 8.2, and i'm new to linux, though i've used some Sun at school ..... what up?
edit: found it. it's got a different name in suse, and i hadn't told it to show hidden files.