With this line of code I generate an output of every result.exec(find ics/ -mmin +3 -type f -name '*.pdx' -exec basename {} ';' > ./tmp/filename) How can I generate a file with dynamic file name everytime?Like this: ./tmp/filename_{*Here should be the dynamic name*}
Create file for every result of find command?
files;find;filenames;exec
You can start a new shell and provide the file as an argument. Then use POSIX parameter expansion to get rid of the path and if desiredthe extension:find . -type f -name *.pdx \  -exec sh -c \    'base=${0##*/}; printf %s\n $base > ./tmp/filename_${base%.pdx}' {} \;