Getting the most from a command ...

Hello All,

Has been a while since I was last on so I do apologize for my absence :slight_smile:

Have had a need to throw myself into scripting again and in need of a little assistance ...

Just tested the following and it works as anticipated ...

find . \( ! -name \. -prune \) -name \[A-Za-z\]\*_stdout -type f -xdev | sed s%\.\/%% | xargs -i mv {} `date '+%Y%m%d'`.{}

My only outstanding need is to be able to 'touch' the same file originally selected from the 'find'/'sed' statement after the 'move'.

Does anyone know how & if this can be done with the above without the need to create a wrapper script ?

Cheers,
Cameron

Something like?

find . \( ! -name \. -prune \) -name \[A-Za-z\]\*_stdout -type f -xdev | sed s%\.\/%% | xargs -i bash -c 'mv {} `date '+%Y%m%d'`.{}; touch {}'

Many thanks bartus11.

Has worked a treat.

Cheers,
Cameron