There is a utility script pipe command in IOS-XR. the script option (like many things in IOS-XR it seems) is undocumented. Where is the proper location for scripts to live? it appears to want them in /misc/scratch (or /disk0:, which is the same thing), but this seems like a bad idea, as I've already had a script replaced with the following:
[hostname:/misc/scratch]$ cat ipv6_route_wide.awk
TRUNCATED by /usr/bin/filecleanup.sh
Also, filecleanup.sh actually lives in /etc and not /usr/bin
I tried a couple of alternatives, only to get the error
script: /usr/bin/ipv6_route_wide.awk : path outside filesystem
So it seems, scripts have to live in /misc/scratch.
I am currently on 7.5.1