Hi Alain !

>What I usualy do is to have a command line parameter when it is
>invoked by another script or cron. This is easy to test as $1 Then if
>the script is called from the user there is no parameter (or different
>ones)

May even be done with environment settings. A calling script can spawn
a command with a special value set in environment. This is missing if
called interactively.

>I hope that this is possible in your case

Sorry no. The script (doit in my example) is at most times called
by manually entering a command in an interactive shell. Only a few
cases may use the script from within another script. Those rare cases
cold be catched by a wrapper script to setup special conditions. But
the really interesting case is, when script is called manually. Either
from a top level shell (child of pid 1 = shell is session leader) or
from any nested shell (e.g shell in a terminal emulator).

In the past I fiddled with the terminal test "[ -t 0 ]" or the tty
command, but this is error prune. I really do not know to which type of
terminal the shells are connected. I even have the case where a top
interactive shell is running on a pseudo tty ... the case where old
script failed and a novice decided to just turn off the pc (with
a heavily running background job) :-(

--
Harald
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to