I am randomly selecting files from a directory that I want to process, and I want to apply the touch command to them so that I know the last one that's been visualized, then apply the visualization program. Something like this:
while [ 1 ]; do ls | shuf | xargs "touch & vizprogram"; done
Since I am manually inspecting these datasets, I want to be able to "Esc" from the loop at any point, so that I interrupt the vizprogram and go through the loop again. Then when I find a file I want to follow on, I want to Ctrl+C and do an ls -rt | tail -n 1
to have the name of the last file I've used. I tried this with a for or while loop instead of xargs
, but then I cannot do "Esc" on the main loop.
Any ideas how to do the "touch then vizprogram" within xargs?