[SATLUG] Help with FIND & AWK commands

Craig sargonemail at gmail.com
Thu May 9 06:45:52 CDT 2013


> In [SATLUG] Help with FIND & AWK commands John-Eric on Tue May 7 00:20:42
> CDT 2013 wrote:
 Giving pseudo-code, as this looks like a potential student class
 assignment.

 ...
> Using grep allows me to search for files using the modified date, time,
> size, name, or some combination.
> Issues:
> #1 I'm not interested in any hidden files but they are still included in
> the find results.
>     The two .mediaartlocal files should not be included.
>     I thought (find . -type f -not -name ".*" ) would exclude hidden
> files
 in awk, break the print into two parts, in one part check for name starting
 with the dot; in the other part do the standard print stuff.

> #2 Is there a better way to print from the 8th token to the end of the
> line?
>     Some classical music files can have very long names.
> "$8-" works for most languages I've used, but evidently, not for bash.
 ...
 Substitue awk number of fields for "end of line" and apply appropriate
 programming construct(s) as needed to print from $8 to NF.

 Craig


More information about the SATLUG mailing list