Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

diff /usr/bin/ps /usr/ucb/ps

Status
Not open for further replies.

grindel

Technical User
Jun 25, 2002
36
CA
I'm confused - as the subject suggests, if I do a
"diff /usr/bin/ps /usr/ucb/ps" I get no differences at all. The files are the same size, the checksums are the same. But, they are different programs! Dude, WTF????
 
there is a program named isaexec, which contains the code of several Commands:

# ls -ail /usr/bin/ps /usr/ucb/ps
490440 -r-xr-xr-x 42 root bin 5416 Apr 7 2002 /usr/bin/ps
490440 -r-xr-xr-x 42 root bin 5416 Apr 7 2002 /usr/ucb/ps
# find / -inum 490440
/usr/bin/newtask
/usr/bin/nohup
/usr/bin/prctl
/usr/bin/prstat
/usr/bin/ps
/usr/bin/savecore
/usr/bin/setuname
/usr/bin/uptime
/usr/bin/w
/usr/bin/pargs
/usr/bin/pcred
/usr/bin/pfiles
/usr/bin/pflags
/usr/bin/pldd
/usr/bin/pmap
/usr/bin/ppgsz
/usr/bin/preap
/usr/bin/prun
/usr/bin/psig
/usr/bin/pstack
/usr/bin/pstop
/usr/bin/ptime
/usr/bin/ptree
/usr/bin/pwait
/usr/bin/pwdx
/usr/bin/sort
/usr/bin/adb
/usr/bin/mdb
/usr/bin/gcore
/usr/bin/plimit
/usr/bin/truss
/usr/bin/prex
/usr/bin/tnfxtract
/usr/bin/cputrack
/usr/lib/isaexec
/usr/sadm/lib/wbem/rds
/usr/sbin/lockstat
/usr/sbin/prtconf
/usr/sbin/swap
/usr/sbin/sysdef
/usr/sbin/whodo
/usr/ucb/ps
^C# grep /usr/ucb/ps /var/sadm/install/contents
/usr/ucb/ps=../../usr/lib/isaexec l none SUNWscpu
#

I think onlz Sun can tell zou whz thez designed it like that...

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Here is the reason, I believed:

The /usr/bin/ps came from SVR4 (Solaris 2.X/7/8/9, or SunOS5.X), and the /usr/ucb/ps came from BSD (Solaris 1.X, or SunOS4.X).

At looong time ago they were different, but now the BSD almost gone, there is no need to maintain two different version anymore...


Cheers,


Achech
 
This is fairly common. A programmer will write a single piece of code and depending on what name is used to call it, it will act appropriately. Here's a silly little script that I run to mount a cdrom on an AIX system which shows this:

Code:
#!/usr/bin/ksh

if [ $0 = /usr/local/bin/mount-cdrom ] ; then
        mount -V cdrfs -o ro /dev/cd0 /mnt
elif [ $0 = /usr/local/bin/umount-cdrom ] ; then
        umount /mnt
elif [ $0 = /usr/local/bin/unmount-cdrom ] ; then
        umount /mnt
fi

exit

Depending on which name I use to call it, it will either mount or unmount a cdrom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top