History of AFNI updates  

|
June 02, 2015 05:41PM
Huh. It seems to be taking me two tries to flush it, which I can't explain. But try this:
afni -yesplugouts | grep --line-buffered 'RAI xyz' | tee coords.txt&
{
    echo GETENV bogus
    while :; do
        read -n1 -r -p $'\nPress "q" to quit or any other key to dump coordinates\n' 1>&2
        if [ "$REPLY" == q ]; then
             echo QUIT
             break
        fi
        echo GET_DICOM_XYZ
        echo GETENV bogus
        echo GETENV bogus
    done
} | plugout_drive &>/dev/null
Notice the --line-buffered option to grep, which is necessary to prevent the pipe to tee from turning on block buffering. (It turns out the previous command would have eventually produced output without quitting-- but not until you'd instructed it to dump 64K worth of coordinates!)

EDIT: This is bash, and probably won't work on tcsh. But you can just run bash, copy the code in to run it, and then run "exit" to get out of bash and back to tcsh.



Edited 1 time(s). Last edit at 06/02/2015 05:44PM by Isaac Schwabacher.
Subject Author Posted

Plugout_Drive GET_DICOM_XYZ output

rollom June 01, 2015 05:22PM

Re: Plugout_Drive GET_DICOM_XYZ output

Isaac Schwabacher June 01, 2015 06:29PM

Re: Plugout_Drive GET_DICOM_XYZ output

rollom June 02, 2015 12:54PM

Re: Plugout_Drive GET_DICOM_XYZ output

Isaac Schwabacher June 02, 2015 02:45PM

Re: Plugout_Drive GET_DICOM_XYZ output

rollom June 02, 2015 04:21PM

Re: Plugout_Drive GET_DICOM_XYZ output

Daniel Glen June 02, 2015 05:37PM

Re: Plugout_Drive GET_DICOM_XYZ output

Isaac Schwabacher June 02, 2015 05:41PM

Re: Plugout_Drive GET_DICOM_XYZ output

rollom June 03, 2015 10:33AM

Re: Plugout_Drive GET_DICOM_XYZ output

Daniel Glen June 03, 2015 01:47PM

Re: Plugout_Drive GET_DICOM_XYZ output

rollom June 03, 2015 02:21PM