I want to traverse a directory tree and find all of the shell scripts, and then based on that I need to perfrom further processing. So I have something like
Thanks for the input guys, but what I want to do is:-
Traverse a complete directory tree - not just a single directory
I don't want to look for "script" in either the filename or the content of the file. I want to look for it in the output of the 'file' command being run on each file found in turn.
I'm natively using Korn shell on Solaris 10, but could drop into bash/csh/sh if I have to!
Yes, I think I could use xargs in this case, but to an extent, I'm more interested in finding out the correct way (assuming there is one!) to use a pipe within a find -exec clause, 'cos then I can use it for all sorts of things in the future!