Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. chrchcol

    Help with an awk output

    I found a command that worked almost completley <c>z=`ls -la "$f" | awk '{ printf("%-15s\t%10d\n", $9, $5)}'`</c> This command works perfect. The onlyput I need is $5 though. When I remove $9 it does not work. Is there something I am missing? Chris
  2. chrchcol

    Help with an awk output

    I hope I wasn't being rude, I was just letting you know I could not get the Typeset command to work with those switches. I do see the command for typeset and have been trying to play with it. Chris
  3. chrchcol

    Help with an awk output

    I just checked it does not work in bash.
  4. chrchcol

    Help with an awk output

    Will that also work using Bash?
  5. chrchcol

    Help with an awk output

    OK now I am totally confused, the code you gave me worked perfect on the command line. It was Right aligned. <CODE>ls -la | awk '{s[NR]=$5;if(l<length($5))l=length($5)}END{for(i=1;i in s;i++)printf"%"l"s\n",s[i]}'</CODE> However when I tried to add it into my script and added this <CODE> for...
  6. chrchcol

    Help with an awk output

    Well, the output of the ls -la command for size would be the larger sizes would be to the left and on the right the smaller sizes line up. Such as 123456 123 567 33 123456 That would be correct. WHen you use ls -la | awk '{print $5}' The output looks more like 123456 22 234 235...
  7. chrchcol

    Help with an awk output

    I am using z=`ls -la "$f" | awk '{print $5} to pipe the filenames from one variable into another variable for later output. However the filenames print left to right, I really need them to print right to left the way they do in the ls -la command chris

Part and Inventory Search

Back
Top