Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
symlinks and reverse compatiblity and strange filenames
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
corley
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2005
Posts: 78

PostPosted: Tue Jul 26, 2005 4:01 am    Post subject: symlinks and reverse compatiblity and strange filenames Reply with quote

I noticed today I had a filename called /usr/bin/[ (a bracket). I opened it and it looks to be a copy of something from core-utils.

Code:

^@bug-coreutils@gnu.org^@/usr/share/locale^@Matthew Bradburn^@Kevin Braunsdorf^@5.2.1^@GNU coreutils^@[^@missing `]'
^@too many arguments


I check the date of the file against some others in the same directory and there are some strange symlinks to the same files. example

Code:

-rwxr-xr-x  1 root root      25720 Jun 12 23:27 [
lrwxrwxrwx  1 root root         13 Jun 12 23:27 basename -> /bin/basename
lrwxrwxrwx  1 root root          8 Jun 12 23:27 cat -> /bin/cat
lrwxrwxrwx  1 root root         10 Jun 12 23:27 chgrp -> /bin/chgrp
lrwxrwxrwx  1 root root         10 Jun 12 23:27 chmod -> /bin/chmod
lrwxrwxrwx  1 root root         10 Jun 12 23:27 chown -> /bin/chown
lrwxrwxrwx  1 root root         11 Jun 12 23:27 chroot -> /bin/chroot
lrwxrwxrwx  1 root root         10 Jun 12 23:27 cksum -> /bin/cksum
lrwxrwxrwx  1 root root          9 Jun 12 23:27 comm -> /bin/comm
lrwxrwxrwx  1 root root          7 Jun 12 23:27 cp -> /bin/cp
-rwxr-xr-x  1 root root      32544 Jun 12 23:27 csplit
lrwxrwxrwx  1 root root          8 Jun 12 23:27 cut -> /bin/cut
lrwxrwxrwx  1 root root          9 Jun 12 23:27 date -> /bin/date
lrwxrwxrwx  1 root root          7 Jun 12 23:27 dd -> /bin/dd
lrwxrwxrwx  1 root root          7 Jun 12 23:27 df -> /bin/df
lrwxrwxrwx  1 root root          8 Jun 12 23:27 dir -> /bin/dir
lrwxrwxrwx  1 root root         14 Jun 12 23:27 dircolors -> /bin/dircolors
lrwxrwxrwx  1 root root         12 Jun 12 23:27 dirname -> /bin/dirname
lrwxrwxrwx  1 root root          7 Jun 12 23:27 du -> /bin/du
lrwxrwxrwx  1 root root          9 Jun 12 23:27 echo -> /bin/echo
lrwxrwxrwx  1 root root          8 Jun 12 23:27 env -> /bin/env
-rwxr-xr-x  1 root root      18780 Jun 12 23:27 expand
lrwxrwxrwx  1 root root          9 Jun 12 23:27 expr -> /bin/expr
-rwxr-xr-x  1 root root      21360 Jun 12 23:27 factor
lrwxrwxrwx  1 root root         10 Jun 12 23:27 false -> /bin/false
-rwxr-xr-x  1 root root      21312 Jun 12 23:27 fmt
-rwxr-xr-x  1 root root      19796 Jun 12 23:27 fold
lrwxrwxrwx  1 root root          9 Jun 12 23:27 head -> /bin/head
lrwxrwxrwx  1 root root         11 Jun 12 23:27 hostid -> /bin/hostid
lrwxrwxrwx  1 root root          7 Jun 12 23:27 id -> /bin/id
lrwxrwxrwx  1 root root         12 Jun 12 23:27 install -> /bin/install
-rwxr-xr-x  1 root root      29068 Jun 12 23:27 join
lrwxrwxrwx  1 root root          9 Jun 12 23:27 link -> /bin/link
lrwxrwxrwx  1 root root          7 Jun 12 23:27 ln -> /bin/ln
lrwxrwxrwx  1 root root         12 Jun 12 23:27 logname -> /bin/logname
lrwxrwxrwx  1 root root          7 Jun 12 23:27 ls -> /bin/ls
-rwxr-xr-x  1 root root      31960 Jun 12 23:27 md5sum
lrwxrwxrwx  1 root root         10 Jun 12 23:27 mkdir -> /bin/mkdir
lrwxrwxrwx  1 root root         11 Jun 12 23:27 mkfifo -> /bin/mkfifo
lrwxrwxrwx  1 root root         10 Jun 12 23:27 mknod -> /bin/mknod
lrwxrwxrwx  1 root root          7 Jun 12 23:27 mv -> /bin/mv
lrwxrwxrwx  1 root root          9 Jun 12 23:27 nice -> /bin/nice
-rwxr-xr-x  1 root root      21984 Jun 12 23:27 nl
lrwxrwxrwx  1 root root         10 Jun 12 23:27 nohup -> /bin/nohup
-rwxr-xr-x  1 root root      34360 Jun 12 23:27 od
-rwxr-xr-x  1 root root      17404 Jun 12 23:27 paste
-rwxr-xr-x  1 root root      16184 Jun 12 23:27 pathchk
-rwxr-xr-x  1 root root      20384 Jun 12 23:27 pinky
-rwxr-xr-x  1 root root      39028 Jun 12 23:27 pr
lrwxrwxrwx  1 root root         13 Jun 12 23:27 printenv -> /bin/printenv
-rwxr-xr-x  1 root root      23984 Jun 12 23:27 printf
lrwxrwxrwx  1 root root          8 Jun 12 23:27 ptx -> /bin/ptx
lrwxrwxrwx  1 root root          8 Jun 12 23:27 pwd -> /bin/pwd
lrwxrwxrwx  1 root root         13 Jun 12 23:27 readlink -> /bin/readlink
lrwxrwxrwx  1 root root          7 Jun 12 23:27 rm -> /bin/rm
lrwxrwxrwx  1 root root         10 Jun 12 23:27 rmdir -> /bin/rmdir
lrwxrwxrwx  1 root root          8 Jun 12 23:27 seq -> /bin/seq
-rwxr-xr-x  1 root root      31960 Jun 12 23:27 sha1sum
-rwxr-xr-x  1 root root      38212 Jun 12 23:27 shred
lrwxrwxrwx  1 root root         10 Jun 12 23:27 sleep -> /bin/sleep
lrwxrwxrwx  1 root root          9 Jun 12 23:27 sort -> /bin/sort
lrwxrwxrwx  1 root root         10 Jun 12 23:27 split -> /bin/split
lrwxrwxrwx  1 root root          9 Jun 12 23:27 stat -> /bin/stat
lrwxrwxrwx  1 root root          9 Jun 12 23:27 stty -> /bin/stty
-rwxr-xr-x  1 root root      24368 Jun 12 23:27 sum
lrwxrwxrwx  1 root root          9 Jun 12 23:27 sync -> /bin/sync
-rwxr-xr-x  1 root root      19668 Jun 12 23:27 tac
-rwxr-xr-x  1 root root      40472 Jun 12 23:27 tail
lrwxrwxrwx  1 root root          8 Jun 12 23:27 tee -> /bin/tee
-rwxr-xr-x  1 root root      23484 Jun 12 23:27 test
lrwxrwxrwx  1 root root         10 Jun 12 23:27 touch -> /bin/touch
lrwxrwxrwx  1 root root          7 Jun 12 23:27 tr -> /bin/tr
lrwxrwxrwx  1 root root          9 Jun 12 23:27 true -> /bin/true
-rwxr-xr-x  1 root root      22496 Jun 12 23:27 tsort
lrwxrwxrwx  1 root root          8 Jun 12 23:27 tty -> /bin/tty
lrwxrwxrwx  1 root root         10 Jun 12 23:27 uname -> /bin/uname
-rwxr-xr-x  1 root root      19488 Jun 12 23:27 unexpand
lrwxrwxrwx  1 root root          9 Jun 12 23:27 uniq -> /bin/uniq
lrwxrwxrwx  1 root root         11 Jun 12 23:27 unlink -> /bin/unlink
-rwxr-xr-x  1 root root      15656 Jun 12 23:27 users
lrwxrwxrwx  1 root root          9 Jun 12 23:27 vdir -> /bin/vdir
lrwxrwxrwx  1 root root          7 Jun 12 23:27 wc -> /bin/wc
lrwxrwxrwx  1 root root          8 Jun 12 23:27 who -> /bin/who
lrwxrwxrwx  1 root root         11 Jun 12 23:27 whoami -> /bin/whoami
lrwxrwxrwx  1 root root          8 Jun 12 23:27 yes -> /bin/yes


I have seen this before when the developers are trying to keep reverse compatibility. I was wondering if anyone else is seeing this, and if so is it due to a bug in a patch that is creating this strange filename.
Back to top
View user's profile Send private message
tomvollerthun
Guru
Guru


Joined: 19 Mar 2005
Posts: 316

PostPosted: Tue Jul 26, 2005 9:31 am    Post subject: Reply with quote

This is normal (as far as normality goes): Some (rather obsolete?) autoconf dialects check for the existence of a "[" programm.
Since on gentoo this is a bash-builtin there is no such program by itself. To satisfy the scripts that look for it, there is a symlink to (or a copy of) bash instead (or maybe a small program just wrapping a call to bash or so...).

The other symlinks can be explained by different pathnames that are searched for p.e. "basename": some scripts expect it to be in /bin while some want it in /usr/bin. Quick and easy solution: have a symlink.

cu, tom
_________________
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Back to top
View user's profile Send private message
TrueDFX
Retired Dev
Retired Dev


Joined: 02 Jun 2004
Posts: 1348

PostPosted: Tue Jul 26, 2005 10:09 am    Post subject: Reply with quote

(Previous deleted post was incorrect.)

[ is correct to exist as a program, and not just for old scripts. Not all shells provide [ as a built-in function (though, as the above poster says, bash does; I first thought it didn't).
Back to top
View user's profile Send private message
tomvollerthun
Guru
Guru


Joined: 19 Mar 2005
Posts: 316

PostPosted: Tue Jul 26, 2005 10:39 am    Post subject: Reply with quote

I see...
So this is as well needed if one uses something else than bash as default shell, right?
_________________
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Back to top
View user's profile Send private message
TrueDFX
Retired Dev
Retired Dev


Joined: 02 Jun 2004
Posts: 1348

PostPosted: Tue Jul 26, 2005 11:18 am    Post subject: Reply with quote

Possibly. bash is not the only shell to provide it as a builtin. zsh and ksh users, at least, have it as a shell builtin as well, so they too could live without it as an external program.
Back to top
View user's profile Send private message
corley
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2005
Posts: 78

PostPosted: Tue Jul 26, 2005 2:17 pm    Post subject: cool Reply with quote

ah thanks alot for the info guys. I just have never noticed a strange filename like that unless it came from a bad pipe, pointer or just some kind of script error, so anytime I see something like that I get suspicious a bit. :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum