2

I want to rz a file and then copy it to a different location. But I find no way to figure out the received filename in the rz help or in its man page. The rz man page, while attempting to be funny, mentions a dubious invocation:

Rz may be invoked as rzCOMMAND (with an optional leading - as generated by login(1)). For each received file, rz will pipe the file to ''COMMAND filename'' where filename is the name of the transmitted file with the file contents as standard input.

That would do (I could pipe it to cat and output a known filename), but how in the world do you invoke rzCOMMAND? rzCAT and rzcat obviously fail.

Am I missing something obvious, or have things been this way since the '80s?

1

If rz doesn't have the sense to somehow return the filename it receives, then a crude hack is to just get the latest modified (ctime-wise) file in the directory and hope no other files were created concurrently:

rz && export FILE_RECEIVED=`ls -t --time=ctime | head -1`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.