I am trying to use find to do something where I need each file as an argument twice.
For an example, let's suppose I wanted to set all of the access times in a tree equal to the modification time.
I thought something like this would work (but it doesn't):
Code: Select all
$ find /usr/local/portage/sys-kernel/gentoo-sources/ -exec touch -d "`date -r {}`" {} ';'
Sure, I could do this (fairly easily even) in two steps - do the find, listing the files and the dates (saving the output to a file), and then editing the file (turning it into a script by putting the touch command at the front of each line), but I am looking for an elegant (meaning one command) solution.
Any ideos?