Last active
May 25, 2022 15:42
Revisions
-
griloHBG revised this gist
May 25, 2022 . No changes.There are no files selected for viewing
-
griloHBG created this gist
May 25, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # making sure that names with spaces won't be a problem IFS=$'\n'; # head to remove the last 2 lines (one blank and one summary) and tail to remove the first line (always a dot) of tree output # TODO: what about *.PDF? for i in $(tree . -f -P "*.pdf" -i | head -n -2 | tail -n +2); # echo the relative file path do echo -n "${i}: "; # if it is a file (and not a directory), perform the conversion [ -f ${i} ] && echo PDF && pdftotext "${i}" "${i}.txt"; done