Announcement

Collapse
No announcement yet.

more PATH questions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    more PATH questions

    when trying to execute a c compiled program called size
    Code:
    ant2ne@ant2ne-laptop:~$ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/ant2ne/batch:/home/ant2ne/C
    ant2ne@ant2ne-laptop:~$ pwd
    /home/ant2ne
    ant2ne@ant2ne-laptop:~$ size
    size: 'a.out': No such file
    ant2ne@ant2ne-laptop:~$ cd C
    ant2ne@ant2ne-laptop:~/C$ pwd
    /home/ant2ne/C
    ant2ne@ant2ne-laptop:~/C$ size
    size: 'a.out': No such file
    ant2ne@ant2ne-laptop:~/C$ ~/C/size
    PROGRAM EXECUTES
    Why, if size is located in the PATH does it not execute?
    Registered Linux User: 450747<br />Registered Ubuntu User: 16269

    #2
    Re: more PATH questions

    Actually, size gets executed - but the Linux one ...

    In more detail: you've reused the name of an installed Linux installed program (rarely a good idea), to the effect that in the absence of a full path, the first program of the name in question is going to executed:

    Code:
    # which size
    /usr/bin/size
    Of course, reverse the sequence of "PATHs" (on your own risk) would change this behaviour - but avoiding "double names" would be a more sensible approach, I'd say

    Comment

    Working...
    X