[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Is redirecting stdout/stderr in postinst allowed?



Hi,

the developers' reference says in 6.4:

| Standard input and output may be redirected (e.g. into pipes) for
| logging purposes, so don't rely on them being a tty.

So far, so good. But is it o.k. if the script itself performs
redirections? For example something like the following in postinst:

db_get mypackage/someinfo

VAR=`process $RET | mangle with $WHATEVER`

exec 3>&1 >> $someconffile
echo "#added by postinst"
echo $VAR
exec >&3

Of course in this case, a here-document would be sufficient, but not
generally. 

TIA, Frank
-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie



Reply to: