|
Prev: Thread dump with kill -3 pid
Next: Need help with grep
From: James Michael Fultz on 2 Feb 2008 12:44 * lbrtchx(a)gmail.com <lbrtchx(a)gmail.com>: > Hi, > ~ > you can recursively produce a listing of all files from a certain > directory with the script > ~ > find . -type f -ls | awk '{print $11}' find . -type f -print > ~ > I haven't still figured out how to filter certain files, say all with > ".html" or ".htm" extension find . -type f \( -name '*.html' -o -name '*.htm' \) -print > ~ > and then run a command though all of them and dropping the output in > the directory where the source was (safely renaming them would be a > nice extra) Investigate find's '-exec' or '-execdir' if your version of find supports it. > ~ > I am trying to run tidy through a bunch of files at once Note that this will overwrite the original files. find . -type f \( -name '*.html' -o -name '*.htm' \) -exec tidy -m {} \; Alernatively, writing to new files with a '.new' extension. find . -type f \( -name '*.html' -o -name '*.htm' \) -exec tidy -o {}.new {} \; Anything more complex would be best be accomplished by wrapping tidy in a script and having 'find ... -exec ...' call that. > ~ > Thanks > lbrtchx -- James Michael Fultz <xyzzy(a)sent.as.invalid> Remove this part when replying ^^^^^^^^
|
Pages: 1 Prev: Thread dump with kill -3 pid Next: Need help with grep |