piyush.neo
February 8th, 2010, 09:46 AM
Plateform-Ubuntu 9.10
test is a shell built in command in /usr/bin/test..
when i am making a executable file named test in my current directory its not working but if i change its name to some thing else it works....
here is series of command
Piyush@piyush-machine:~$ echo 'echo hello' >test
piyush@piyush-machine:~$ cat test
echo hello
piyush@piyush-machine:~$ chmod +x test
piyush@piyush-machine:~$ ls -l test
-rwxr-xr-x 1 piyush piyush 12 2010-02-08 14:02 test
piyush@piyush-machine:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Piyush@piyush-machine:~$ PATH=:.:$PATH #include current dir
piyush@piyush-machine:~$ echo $PATH
:.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
piyush@piyush-machine:~$ test
piyush@piyush-machine:~$ cp test nottest
piyush@piyush-machine:~$ nottest
hello
piyush@piyush-machine:~$ which test
./test
why test command is not executing inspite the shell is using the test of my present dir?
test is a shell built in command in /usr/bin/test..
when i am making a executable file named test in my current directory its not working but if i change its name to some thing else it works....
here is series of command
Piyush@piyush-machine:~$ echo 'echo hello' >test
piyush@piyush-machine:~$ cat test
echo hello
piyush@piyush-machine:~$ chmod +x test
piyush@piyush-machine:~$ ls -l test
-rwxr-xr-x 1 piyush piyush 12 2010-02-08 14:02 test
piyush@piyush-machine:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Piyush@piyush-machine:~$ PATH=:.:$PATH #include current dir
piyush@piyush-machine:~$ echo $PATH
:.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
piyush@piyush-machine:~$ test
piyush@piyush-machine:~$ cp test nottest
piyush@piyush-machine:~$ nottest
hello
piyush@piyush-machine:~$ which test
./test
why test command is not executing inspite the shell is using the test of my present dir?