Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Process expansion
- X-seq: zsh-users 13769
- From: Stathy Touloumis <stathy@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Process expansion
- Date: Tue, 27 Jan 2009 14:04:16 -0600
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I am working with an installed application and trying to override a 
built in script using a ZSH function.  Sometimes the script (foo) is 
called from other scripts by creating a sub-process call :
## sample from script calling
OUT=`foo arg1 arg2`
echo $OUT
I am looking to override this script with a function call to leverage an 
existing authentication handle.  Is this possible?  I have tried using 
named pipes and shell expansion with no luck.
## Override with function
function foo() {
 echo "args $@";
## Trying to pass back to calling process which has shared 
authentication handle
   echo $@ >($$)
   kill -INT $$
}
## This is initiated in calling process which has access to shared 
authentication handle.
sigint foo_handler()
{
 if [[ -z $HANDLE ]]
 then
   resource_connect
   HANDLE=$$
 fi
 while read ARGS
 do
   resource_call $ARGS
 done
}
trap foo_handler INT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author