awk question

gs_stoller at juno.com gs_stoller at juno.com
Fri Mar 9 18:47:32 UTC 2007


	You are trying to remove the files whose names are given by
		ls -lt | awk '{if ($8 == 2006) print $9}';

	If you are in the same directory, or you have full pathnames, you can
do just (and avoid the 'for  do  done' loop)
		rm  $( ls -lt | awk '{if ($8 == 2006) print $9}' )
	If this exceeds the maximum length of a line, just use  xargs  also.




More information about the freebsd-questions mailing list