Re: All true assertions in a bash find one liner? ...
> We can't really "see what you mean" until you show us. Why don't you
> just tell us the actual problem? It can't be THAT embarrassing.
OK, here it is again. You will see that as part of the output you
will see a bunch of paths (with the actual matches) that someone were
not picked by the -printf statement.
# extensions
_X=".\(java\|txt\)"
# search directory
_SDIR="/home/$(whoami)/java"
# search string
_W="java.io.UnsupportedEncodingException;"
###
_DT=$(date +%Y%m%d%H%M%S)
_LOG_FL=$(basename "${_SDIR}")"_find_${_DT}.log"
echo "// __ \$_LOG_FL: |${_LOG_FL}|"
find "${_SDIR}" -type f -iregex .*"${_X}" -printf '"%TD
%TT",%Ts,%s,"%P"\n' -exec grep --files-with-matches "${_W}" {} \; >
"${_LOG_FL}" 2>&1
cat "${_LOG_FL}" | grep -e "^${_SDIR}"
Reply to: