Apr 8, 2008 #1 gatetec MIS Mar 22, 2007 420 US ls -al *prod_* | awk '{ print $10}' This returns blank rows along with the rows with data. I'd like to omit the blank rows so that I can have the rows with data only. Pls advise. thx much
ls -al *prod_* | awk '{ print $10}' This returns blank rows along with the rows with data. I'd like to omit the blank rows so that I can have the rows with data only. Pls advise. thx much
Apr 8, 2008 1 #2 khalidaaa Technical User Jan 19, 2006 2,323 BH What are you looking at by choosing $10? usually there are 9 field in the ls -al output! unless there is a symbolic link or so! Never mind, Try this: ls -al | awk '{print $10}' | awk 'length >1' Regards, Khalid Upvote 0 Downvote
What are you looking at by choosing $10? usually there are 9 field in the ls -al output! unless there is a symbolic link or so! Never mind, Try this: ls -al | awk '{print $10}' | awk 'length >1' Regards, Khalid
Apr 9, 2008 Thread starter #3 gatetec MIS Mar 22, 2007 420 US thx so much. It works great! Upvote 0 Downvote
Apr 9, 2008 #4 p5wizard IS-IT--Management Apr 18, 2005 3,165 BE Why 2nd awk process? [tt]ls -al | awk '{if ($10) print $10}'[/tt] But I only get "->" strings from the long listing of symlinks or on /dev, the name of all 'c' or 'b' devices... HTH, p5wizard Upvote 0 Downvote
Why 2nd awk process? [tt]ls -al | awk '{if ($10) print $10}'[/tt] But I only get "->" strings from the long listing of symlinks or on /dev, the name of all 'c' or 'b' devices... HTH, p5wizard