Immediately redirect output of a program to a different directory

Normally, I call a program from inside $path_to_program, which accepts an initialization file. Basically, how I run it is ./program file.in. After the program starts, it creates some binary output files (let's call them out1, out2, out3).

However, I would like to immediately move out1, out2, out3 to another directory $path_another so that output files are not written inside $path_to_program. Is it possible to do that?

I tried different standard approaches, like calling my program from inside $path_another with $path_to_program/program file.in, but the file.in is not found. I found different methods, but most of them redirect output to .txt or .log file. I apologize, if this a duplicate question, but I couldn't find a working answer.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论