2 ms·
A number of traditional unix utilities change their behavior based on what their name is. /bin/test and /bin/[ come to mind. but I just checked and a quick surv
by somat 2y ago
A number of traditional unix utilities change their behavior based on what their name is. /bin/test and /bin/[ come to mind. but I just checked and a quick survey of openbsd finds.
eject mt
[ test
chgrp chmod
cksum md5 sha1 sha256 sha512
cpio pax tar
ksh rksh sh
taken to it's logical extreme you end up with somthing like crunchgen https://man.openbsd.org/crunchgen https://man.openbsd.org/crunchgen which merges many independent programs into one and select which one to run based on the name.
And I am guilty of abusing symbolic links as a simple single value key value store. It turns out the link does not need to point to anything and using readlink(1) was easier than parsing a file.
- cduzz 2y agossh and rsh used to cause you to rsh/ssh to the name of the file... so I had, in my home directory ~me/bin/snoopy and if I wanted to log into snoopy, I'd just type $ snoopy and it'd rsh me into snoopy. Hilarity was the day when someone ran cd /export/home && for user in * ; do chown -R $user:users ; done (note the lack of the -h flag, which causes the ownership of the symbolic link instead of the reference of the symbolic link to be chowned)