#!/bin/rc debug = 1 fn testfn { echo 'debug: '$debug arg1 = $1 arg2 = $2 arg3 = $3 echo $arg1 $arg2 $arg3 } { echo 'arg1' echo 'arg2' echo 'arg3' } | xargs -n 3 echo # this will not work as it becomes recursive calls. # would have to split the testfn into a different file { echo 'arg1' echo 'arg2' echo 'arg3' } | xargs -n 3 rc -xvc 'cd '^`{pwd}^'; . test.rc; testfn $*'