Need help fixing a strange path error in bash
- by Evan
UPDATE
Ok, I found some errors in the path which I think I fixed, but now it's not running in any case - which for some reason I think is a step forward. Thanks for suggesting the following steps, here is their output:
user@computer:~$ echo $PATH
/usr/share/fsl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/local/matlab/bin:/usr/local/VoxBo/bin:/usr/local/itt/idl64/bin:/usr/local/afni/bin/:/usr/local/mricron:/usr/lib/voxbo/bin:/home/user/folder:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11/:/usr/games/:/usr/local/matlab/bin:/usr/local/VoxBo/bin/:/usr/local/itt/idl64/bin:/usr/local/afni/bin/:/usr/local/mricron/
user@computer:~$ typeset -p PATH
declare -x PATH="/usr/share/fsl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/local/matlab/bin:/usr/local/VoxBo/bin:/usr/local/itt/idl64/bin:/usr/local/afni/bin/:/usr/local/mricron:/usr/lib/voxbo/bin:/home/user/folder:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11/:/usr/games/:/usr/local/matlab/bin:/usr/local/VoxBo/bin/:/usr/local/itt/idl64/bin:/usr/local/afni/bin/:/usr/local/mricron/"
user@computer:~$ type app1
app1 is /home/user/folder/app1
user@computer:~$ type app2
app2 is /home/user/folder/app2
user@computer:~$ app1
bash: /home/user/folder/app1: No such file or directory
user@computer:~$ app2
bash: /home/user/folder/app2: No such file or directory
user@computer:~$ /home/user/folder/app1
bash: /home/user/folder/app1: No such file or directory
user@computer:~$ /home/user/folder/app2
bash: /home/user/folder/app2: No such file or directory
user@computer:~$ cd /home/user/folder
user@computer:~/folder$ app1
bash: /home/user/folder/app1: No such file or directory
user@computer:~/folder$ ./app1
bash: ./app1: No such file or directory
user@computer:~/folder$ ./app2
bash: ./app2: No such file or directory
user@computer:~/folder$ ls -l
total 29384
-rwxr-xr-x 1 user user 14949776 2011-02-03 11:09 app1
-rwxr-xr-x 1 user user 15137300 2011-02-03 11:10 app2
user@computer:~/folder$
Thanks for everyone's input!
ORIGINAL QUESTION
I have two executable files I downloaded and am trying to add to the path. They are located in
/home/user/folder
and the specific files are
/home/user/folder/app1
/home/user/folder/app2
Both app1 and app2 have the executable flag set to all (user, group, other).
I can execute the files if I am in /home/user/folder and I execute these commands
./app1
./app2
However I can't run them from elsewhere. I added this line to my .profile
PATH="$PATH:/home/user/folder"
and then sourced the path with
. /home/user/.profile
and I can see app1 and app2 when I use command completion (pressing tab). However here is what happens when I try to run app1 or app2 with the following commands (the following only shows 'app1' but the same is true of 'app2')
user@comp:~$ app1
-bash: app1: command not found
user@comp:~$ /home/user/folder/app1
-bash: app1: command not found
user@comp:~/folder$ ./app1
(program runs)
I'm stumped :), I must have missed something simple. Thanks for your help!!