Symlink or hardlink, that would work. It's a trick that a lot of the binutils use. In fact, if you look at busybox, it works exactly that way: use how it was called to determine what command it will "emulate". Of course, the implementation is in c, as opposed to shell script.
On Thu, Oct 16, 2008 at 1:35 AM, Sherwin Daganato <[EMAIL PROTECTED]> wrote: > > > On Wed, Oct 15, 2008 at 10:22 PM, eric pareja <[EMAIL PROTECTED]> wrote: >> >> You can always set environment variables when you install your >> crontab. So a simple if [ -z $VAR ] would work. > > Alternatively, the OP can create a symlink to the script for use with > crontab or in CLI, and then do > if [ $(basename $0) == "..." ] ... > to check whether or not the script is called via the symlink. -- eric pareja ([EMAIL PROTECTED]) LPIC-2 | PGP/GPG Key 0xB82E42D9 Coordinator for Technology / Senior Linux Trainer National Telehealth Center, University of the Philippines Manila International Open Source Network - Southeast Asia "Ang mundo ay aklat, at iisang pahina lamang ang nababasa ng hindi naglalakbay." わかよたれぞ つねならむ _________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List http://lists.linux.org.ph/mailman/listinfo/plug Searchable Archives: http://archives.free.net.ph

