Skip to main content
added 295 characters in body
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

I think you are simply looking for the /tmp directory. AnythingIn most cases, anything you place there will be removed next time you reboot. The details depend on your specific OS and are governed by the value of the $TMPTIME variable. For many distributions, the default is clearing /tmp every boot because $TMPTIME is set to 0. In most (if not all) distributions, this is set in the file /etc/default/rcS.

So, just do something like this (note that I am using shell globbing and not parsing ls):

process_cmd=echo finish_cmd=mv source_dir=some/source/path target_dir=/tmp for f in $source_dir/*; do $process_cmd "$f"; $finish_cmd "$f" $target_dir; done 

I think you are simply looking for the /tmp directory. Anything you place there will be removed next time you reboot. So, just do something like this (note that I am using shell globbing and not parsing ls):

process_cmd=echo finish_cmd=mv source_dir=some/source/path target_dir=/tmp for f in $source_dir/*; do $process_cmd "$f"; $finish_cmd "$f" $target_dir; done 

I think you are simply looking for the /tmp directory. In most cases, anything you place there will be removed next time you reboot. The details depend on your specific OS and are governed by the value of the $TMPTIME variable. For many distributions, the default is clearing /tmp every boot because $TMPTIME is set to 0. In most (if not all) distributions, this is set in the file /etc/default/rcS.

So, just do something like this (note that I am using shell globbing and not parsing ls):

process_cmd=echo finish_cmd=mv source_dir=some/source/path target_dir=/tmp for f in $source_dir/*; do $process_cmd "$f"; $finish_cmd "$f" $target_dir; done 
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

I think you are simply looking for the /tmp directory. Anything you place there will be removed next time you reboot. So, just do something like this (note that I am using shell globbing and not parsing ls):

process_cmd=echo finish_cmd=mv source_dir=some/source/path target_dir=/tmp for f in $source_dir/*; do $process_cmd "$f"; $finish_cmd "$f" $target_dir; done