I have to propagate a value from a command to a
environment variable.
Here is a sketch of how to do this, but I think
there is one problem. (I found this neat idea in
this newsgroup)
I run a series of commands in a script.
I implement the commands I need myself, so
I can do what I will in them.
In the command (mycommand) I write a value (fcode) to
a file.
Then I send some signal, say 8 to PPID (the script)
In the shell I have made this:
trap "read file & set env. variable fcode" 8
Then the idea is to use fcode like this:
#! /usr/bin/ksh
..
..
mycommand params1
case $fcode in
123)
..
..
124)
..
..
mycommand params2
case $fcode in
12)
..
13)
Can one be sure that the signal has been caught and
dealt whith when one comes to case $fcode.
If not, is there some way to achive this (preferrably
in such a way that you dont have to do some stuff
between mycommand and case) ????
Pelle