rsh, like ssh eats the STDIN when run via agent job.  Use the -n flag in the command to make sure we get STDIN back.

rsh xxxxxx -n ls