Sample Header Ad - 728x90

Use command output as argument in watch command

0 votes
2 answers
1196 views
I have a watch on jq -r '.' $(ls -t | head -1)" The goal is to apply "jq -r '.'" to the most recently modified file in directory. Unfortunately, the command used to know the last modified file is evaluated when watch is launched, but not at refresh. How should i write it, so that all of the command is reevaluated at each refresh ? Thanks
Asked by MarvinLeRouge (133 rep)
Oct 18, 2018, 08:08 AM
Last activity: May 2, 2023, 02:05 PM