Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Process expansion



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