Sample Header Ad - 728x90

Write program output to log file containing PID in its name

2 votes
4 answers
10836 views
How can I start a program and write its output to a log file, where the log file contains the PID in its name? I tried program_a > log_$! which doesn't work since $! is the PID of the last program and `program_a' has not finished when the log file is created.
Asked by greole (239 rep)
Mar 19, 2014, 09:19 AM
Last activity: Apr 6, 2019, 12:40 AM