<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to align the space between column in output of the script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177960#M459462</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To eliminate the commas from your output, add the following line just before your 'printf':&lt;BR /&gt;&lt;BR /&gt;# givenname=$(echo "${givenname}"|sed -e 's/,/ /g')&lt;BR /&gt;&lt;BR /&gt;This replaces every comma character with a space.  Thus if there is more than just the first field of the GECOS field, other subfields are left space-delimited.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 28 May 2009 12:10:11 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-05-28T12:10:11Z</dc:date>
    <item>
      <title>How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177951#M459453</link>
      <description>I am using following script to view home folder (/emd/home) size of the users.&lt;BR /&gt;&lt;BR /&gt;My script file:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;cd /emd/home&lt;BR /&gt;echo "SPACE \t \t USERID \t \t USERNAME \t \t LINKED DIRECTORY \n"&lt;BR /&gt;du -sk * | sort -rn | while read line&lt;BR /&gt;do&lt;BR /&gt;space=`echo $line | awk {'print $1'}`&lt;BR /&gt;uname=`echo $line | awk {'print $2'}`&lt;BR /&gt;givenname=`grep ^"$uname:" /etc/passwd|cut -d: -f5`&lt;BR /&gt;linkdir=`ll -nd /emd/home/$uname | awk {'print $11'}`&lt;BR /&gt;#homedir=$(echo /emd/home/$uname)&lt;BR /&gt;echo "$space \t \t $uname \t \t $givenname \t \t $linkdir"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The output is: (Pls find the attachment)&lt;BR /&gt;&lt;BR /&gt;SPACE            USERID                  USERNAME                LINKED DIRECTORY&lt;BR /&gt;&lt;BR /&gt;7468504                  remoquil                Soliman Remoquillo,,,&lt;BR /&gt;5806088                  pzhysl                  Jason Meyers,,,&lt;BR /&gt;3069352                  7en0fm                  Mark Herman&lt;BR /&gt;0584            oddie           Michael Oddie,,,&lt;BR /&gt;3336            bin&lt;BR /&gt;3288            hzrwh7                  Michell Westra,,,&lt;BR /&gt;3080            xz5v8v                  Seban, Elizabeth,,&lt;BR /&gt;5176            deano           Dean Linko,,,&lt;BR /&gt;4608            czhk53                  Vijay Reddy,,,&lt;BR /&gt;3072            zz7msk                  Mike Miller,,,&lt;BR /&gt;2880            erickson                Karl Erickson,,,&lt;BR /&gt;1648            test7           Testin ID&lt;BR /&gt;7680            security&lt;BR /&gt;7296            andersos                Steven Anderson,,,&lt;BR /&gt;6152            3ezaxv                  Colin Copley&lt;BR /&gt;5936            noel            Doug Noel,,,&lt;BR /&gt;4512            src&lt;BR /&gt;4304            xz9wmt                  Rajkumar Molugu,,,&lt;BR /&gt;0                vz1fmk                  Ish Patel,,,&lt;BR /&gt;0                tzrrzp                  Roopesh Shroff,,,               /emd/ansys2/tzrrzp&lt;BR /&gt;0                tpw                             /emd/tpw&lt;BR /&gt;0                tombers                                 /emd/ansys1/tombers&lt;BR /&gt;0                svihla                  Gary Svihla,,,                  /emd/ansys2/svihla&lt;BR /&gt;0                stdlib                  Standards Coord CDMS,,,                 /users/stdlib&lt;BR /&gt;0                schueler                                /emd/ansys2/schueler&lt;BR /&gt;0                rz17by                  Maximo Test,,,&lt;BR /&gt;0                ne7jll                  Lindsay Parsons,,,&lt;BR /&gt;0                ley7ux                  Sridhar Chunduri&lt;BR /&gt;0                kzx4yz                  Greg Langlois,,,&lt;BR /&gt;0                kmoravec                Keith Moravec,,,                /emd/ansys1/kmoravec&lt;BR /&gt;0                jyu             Jin Yu,,,               /emd/ansys1/jyu&lt;BR /&gt;0                jcarr           John Carr,,,            /emd/ansys2/jcarr&lt;BR /&gt;0                fkankuc                 Fanny Kanku,,,&lt;BR /&gt;0                duve                            /emd/ansys1/duve&lt;BR /&gt;0                cp&lt;BR /&gt;0                chobot                  Tony Chobot,,,                  /emd/ansys1/chobot&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pls find the attachment for the current align ment of the above output.</description>
      <pubDate>Wed, 27 May 2009 18:22:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177951#M459453</guid>
      <dc:creator>senthil_kumar_2</dc:creator>
      <dc:date>2009-05-27T18:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177952#M459454</link>
      <description>Hi Senthil:&lt;BR /&gt;&lt;BR /&gt;If you want consistent columnar alignment, use 'printf' with fixed widths and not tab ('\t') characters in an 'echo' statement.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 27 May 2009 18:31:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177952#M459454</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-27T18:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177953#M459455</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this line instead of echo:&lt;BR /&gt;&lt;BR /&gt;printf "%-20s%-20s%-20s%-20s\n" "$space" "$uname" "$givenname" "$linkdir"&lt;BR /&gt;</description>
      <pubDate>Wed, 27 May 2009 18:59:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177953#M459455</guid>
      <dc:creator>Kenan Erdey</dc:creator>
      <dc:date>2009-05-27T18:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177954#M459456</link>
      <description>Hi, Senthil&lt;BR /&gt;&lt;BR /&gt;I use awk's "printf" function for that (that's pretty much the same a the shell's one suggested by James).&lt;BR /&gt;&lt;BR /&gt;I took your script and rewrited:&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;(&lt;BR /&gt;cd /emd/home&lt;BR /&gt;echo "SPACE USERID USERNAME LINKED_DIRECTORY"&lt;BR /&gt;du -sk * | sort -rn | while read space uname&lt;BR /&gt;do&lt;BR /&gt;# space=`echo $line | awk {'print $1'}`&lt;BR /&gt;# uname=`echo $line | awk {'print $2'}`&lt;BR /&gt;givenname=`grep ^"$uname:" /etc/passwd|cut -d: -f5`&lt;BR /&gt;linkdir=`ll -nd /emd/home/$uname | awk {'print $11'}`&lt;BR /&gt;echo "$space $uname $givenname $linkdir"&lt;BR /&gt;done&lt;BR /&gt;)| awk '{printf "%10s %-10s %-15s %s\n", $1, $2, $3, $4}'&lt;BR /&gt;&lt;BR /&gt;Changes: the "read" command can split the input line (no need for the extras "awk" to extract uname y space)&lt;BR /&gt;&lt;BR /&gt;The "echo" lines prints the data with just a single space, the final awk would do all de formating. All echo's go to the same awk as they're within a subshell (bettween parenthesis). All subshell output goes to the final pipe where awk read id.&lt;BR /&gt;&lt;BR /&gt;With this schema is simple to adust the script for varying lenghts in some field, to left o right justify. And, as title and body are processed by the same line, they're always be coherent.&lt;BR /&gt;&lt;BR /&gt;Hope it helps. On my system worked pretty well (see attatch)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 May 2009 19:22:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177954#M459456</guid>
      <dc:creator>Alberto Tagliaferri_2</dc:creator>
      <dc:date>2009-05-27T19:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177955#M459457</link>
      <description>forgot the attatch</description>
      <pubDate>Wed, 27 May 2009 19:24:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177955#M459457</guid>
      <dc:creator>Alberto Tagliaferri_2</dc:creator>
      <dc:date>2009-05-27T19:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177956#M459458</link>
      <description>&lt;!--!*#--&gt;First a small comment&amp;gt;&amp;gt; &lt;BR /&gt;&lt;BR /&gt;"The output is: (Pls find the attachment)"&lt;BR /&gt;&lt;BR /&gt;Good and appreciated attempt, but it is not the actual output. Is appears to be a cut &amp;amp; paste from a screen shot with the TAB characters which are critital to this problem gratuitously, and erroneously, transformed to spaces. To do this properly, redirect to a file and transfer as 'txt'. (Not .DOC not .RTF !).&lt;BR /&gt;&lt;BR /&gt;Anyway... If you are doing all this awking and grepping, then why pretend to write a shell script. Just write a full awk program ?!&lt;BR /&gt;Get in there once, make it do the job, and get out.&lt;BR /&gt;&lt;BR /&gt;You see, I'm a performance guy. So I cringe when I see "grep uname passwd | cut -d: -f5"&lt;BR /&gt;in a loop. For every record processed we read a whole file, and spawn two processes. Read it once, and remember what you need to! &lt;BR /&gt;:-)&lt;BR /&gt;&lt;BR /&gt;The output format ought to the same for the header and a details right? A single awk program can nicely accomplish that.&lt;BR /&gt; &lt;BR /&gt;So where is this rambling leading to?&lt;BR /&gt;Check out the program 'test.awk' below.&lt;BR /&gt;&lt;BR /&gt;It reads /etc/passwd in the "BEGIN" section and fills an array with username -&amp;gt; given-name associations. That section also defines the output format and prints the header.&lt;BR /&gt;&lt;BR /&gt;In the main loop, we look up the username, lookup your directory link, and print the output. Easy?&lt;BR /&gt;&lt;BR /&gt;Run as: &lt;BR /&gt;  du -sk * | sort -rn | awk -f test.awk &amp;gt; test.txt&lt;BR /&gt;&lt;BR /&gt;Results in test.txt:&lt;BR /&gt;&lt;BR /&gt;       SPACE USERID       USERNAME             LINKED&lt;BR /&gt;       ----- ------       --------             ------&lt;BR /&gt;       71864 hein         Hein van den Heuvel  /home/hein/aap&lt;BR /&gt;        2352 test                              /home/hein/noot&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy !&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BEGIN { FS = ":";&lt;BR /&gt;        while (getline &amp;lt; "/etc/passwd") u[$1] = $5;&lt;BR /&gt;        FS = " ";&lt;BR /&gt;        fmt = "%12s %-12s %-20s %-30s\n"&lt;BR /&gt;        printf fmt, "SPACE", "USERID", "USERNAME", "LINKED", "DIRECTORY";&lt;BR /&gt;        printf fmt, "-----", "------", "--------", "------", "---------";&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;{   space = $1;&lt;BR /&gt;    uname = $2;&lt;BR /&gt;    given = u[uname];&lt;BR /&gt;    "ll -nd /emd/home/" uname | getline;&lt;BR /&gt;    link  = $11;&lt;BR /&gt;    printf fmt, space, uname, given, link;&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 May 2009 19:58:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177956#M459458</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-05-27T19:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177957#M459459</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;...and this thread would appear to be a continuation of your earlier one:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1341889" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1341889&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 27 May 2009 20:28:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177957#M459459</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-27T20:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177958#M459460</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Instead of this below line or your script&lt;BR /&gt;echo "$space \t \t $uname \t \t $givenname \t \t $linkdir"&lt;BR /&gt;&lt;BR /&gt;use this line into your script&lt;BR /&gt;printf "%-15s %20s %20s %20s" $space $uname  $givenname $linkdir&lt;BR /&gt;&lt;BR /&gt;Suraj&lt;BR /&gt;</description>
      <pubDate>Thu, 28 May 2009 03:49:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177958#M459460</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-05-28T03:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177959#M459461</link>
      <description>Hi Friends,&lt;BR /&gt;&lt;BR /&gt; I modified the script as per your suggestion. now i am able to get the output aligned.&lt;BR /&gt;&lt;BR /&gt;Modified script is:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;cd /emd/home&lt;BR /&gt;printf "%-10s %-15s %-35s %-25s\n" "SPACE" "USERID" "USERNAME" "LINKED_DIRECTORY"&lt;BR /&gt;printf "%-10s %-15s %-35s %-25s\n" "-----" "------" "--------" "----------------"&lt;BR /&gt;du -sk * | sort -rn | while read space uname&lt;BR /&gt;do&lt;BR /&gt;#space=`echo $line | awk {'print $1'}`&lt;BR /&gt;#uname=`echo $line | awk {'print $2'}`&lt;BR /&gt;givenname=`grep ^"$uname:" /etc/passwd|cut -d: -f5`&lt;BR /&gt;linkdir=`ll -nd /emd/home/$uname | awk {'print $11'}`&lt;BR /&gt;&lt;BR /&gt;printf "%-10s %-15s %-35s %-25s\n" "$space" "$uname" "$givenname"  "$linkdir"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My output is:&lt;BR /&gt;&lt;BR /&gt;SPACE      USERID          USERNAME                            LINKED_DIRECTORY&lt;BR /&gt;-----      ------          --------                            ----------------&lt;BR /&gt;7468504    remoquil        Soliman Remoquillo,,,&lt;BR /&gt;5806312    pzhysl          Jason Meyers,,,&lt;BR /&gt;3069352    7en0fm          Mark Herman&lt;BR /&gt;2033224    wabtec          Wabtec sharedaccount,,,&lt;BR /&gt;1966224    paez&lt;BR /&gt;1961688    7e8e9u          Steven Dettloff,,,&lt;BR /&gt;1888472    mentordata&lt;BR /&gt;1810456    infodba         Iman Administrator,,,&lt;BR /&gt;1650224    tek&lt;BR /&gt;1536368    reydl2          Matthew A Sawtell,,,&lt;BR /&gt;269904     common_box&lt;BR /&gt;0          zzw2cc          Cherl Nordmann,,,&lt;BR /&gt;0          zehjrf&lt;BR /&gt;0          vzh53p          Walter Klaric,,,&lt;BR /&gt;0          vz1fmk          Ish Patel,,,&lt;BR /&gt;0          tzrrzp          Roopesh Shroff,,,                   /emd/ansys2/tzrrzp&lt;BR /&gt;0          tpw                                                 /emd/tpw&lt;BR /&gt;0          tombers                                             /emd/ansys1/tombers&lt;BR /&gt;0          svihla          Gary Svihla,,,                      /emd/ansys2/svihla&lt;BR /&gt;0          stdlib          Standards Coord CDMS,,,             /users/stdlib&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here i want one more to be done.&lt;BR /&gt;&lt;BR /&gt;In username column of the report is displaying the 5th column (GECOS) of the "/etc/passwd".&lt;BR /&gt;&lt;BR /&gt;Previous unix admin of our company userd to give three commas (,,,) after each names mentioed in the 5th column (comment field) of the passwd file.&lt;BR /&gt;&lt;BR /&gt;Now i want to remove commas (,,,) if it is suffixed with the name.&lt;BR /&gt;&lt;BR /&gt;Here I want the name only but not commas.&lt;BR /&gt;&lt;BR /&gt;Pls  give your suggestion on modifying the script.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have attached the file containing my script and output report.</description>
      <pubDate>Thu, 28 May 2009 11:55:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177959#M459461</guid>
      <dc:creator>senthil_kumar_2</dc:creator>
      <dc:date>2009-05-28T11:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177960#M459462</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To eliminate the commas from your output, add the following line just before your 'printf':&lt;BR /&gt;&lt;BR /&gt;# givenname=$(echo "${givenname}"|sed -e 's/,/ /g')&lt;BR /&gt;&lt;BR /&gt;This replaces every comma character with a space.  Thus if there is more than just the first field of the GECOS field, other subfields are left space-delimited.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 May 2009 12:10:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177960#M459462</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-28T12:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177961#M459463</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;change givenname as :&lt;BR /&gt;&lt;BR /&gt;givenname=`grep ^"$uname:" /etc/passwd|cut -d: -f5` | sed -e 's/,//g'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 May 2009 12:14:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177961#M459463</guid>
      <dc:creator>Kenan Erdey</dc:creator>
      <dc:date>2009-05-28T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177962#M459464</link>
      <description>Hi &lt;BR /&gt;try this &lt;BR /&gt;&lt;BR /&gt;givenname=$(echo "${givenname}"|sed -e 's/,/ /g')&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sunny</description>
      <pubDate>Thu, 28 May 2009 12:19:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177962#M459464</guid>
      <dc:creator>Sunny123_1</dc:creator>
      <dc:date>2009-05-28T12:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177963#M459465</link>
      <description>&lt;!--!*#--&gt;i prefer Hein's solution too, there are a lot of 'heavy' shell commands piped together, and the performance suffers this way. IMHO the best way would be to write it all in awk...&lt;BR /&gt;&lt;BR /&gt;Hein, nice coding! But can we call this &lt;BR /&gt;"du -sk * | sort -rn" thing inside of awk? ;)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 May 2009 20:22:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177963#M459465</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2009-05-28T20:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177964#M459466</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Here I want the name only but not commas&lt;BR /&gt;&lt;BR /&gt;There are 2 easy way to remove comma &lt;BR /&gt;1. open your output into vi &lt;BR /&gt;at the vi command prompt give this&lt;BR /&gt;:1,$s/,,,//gp&lt;BR /&gt;&lt;BR /&gt;2. assum your output is in out.txt file&lt;BR /&gt;now give this command at comman prompt&lt;BR /&gt;#sed 's/,,,//'&lt;OUT.TXT&gt;&lt;/OUT.TXT&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Fri, 29 May 2009 03:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177964#M459466</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-05-29T03:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177965#M459467</link>
      <description>&amp;gt;Viktor: But can we call this "du -sk * | sort -rn" thing inside of awk? ;)&lt;BR /&gt;&lt;BR /&gt;Yes but why bother. ;-)&lt;BR /&gt;"du -sk *" | getline</description>
      <pubDate>Fri, 29 May 2009 09:51:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177965#M459467</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-29T09:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177966#M459468</link>
      <description>Hi Friends,&lt;BR /&gt;&lt;BR /&gt; Thanks a lot now i am getting correct output that i want.&lt;BR /&gt;&lt;BR /&gt; But some entries are repeating, i want to retain only one entry for each. so how to truncat the other entry.&lt;BR /&gt;&lt;BR /&gt;A)My script:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;cd /emd/home&lt;BR /&gt;printf "%-10s %-15s %-35s %-25s\n" "SPACE" "USERID" "USERNAME" "LINKED_DIRECTORY"&lt;BR /&gt;printf "%-10s %-15s %-35s %-25s\n" "-----" "------" "--------" "----------------"&lt;BR /&gt;du -sk * | sort -rn | while read space uname&lt;BR /&gt;do&lt;BR /&gt;#space=`echo $line | awk {'print $1'}`&lt;BR /&gt;#uname=`echo $line | awk {'print $2'}`&lt;BR /&gt;givenname=`grep ^"$uname:" /etc/passwd|cut -d: -f5|sed 's/,//g'`&lt;BR /&gt;linkdir=`ll -nd /emd/home/$uname | awk {'print $11'}`&lt;BR /&gt;&lt;BR /&gt;printf "%-10s %-15s %-35s %-25s\n" "$space" "$uname" "$givenname"  "$linkdir"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;B)Output:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SPACE      USERID          USERNAME                            LINKED_DIRECTORY&lt;BR /&gt;-----      ------          --------                            ----------------&lt;BR /&gt;7436064    remoquil        Soliman Remoquillo&lt;BR /&gt;5806320    pzhysl          Jason Meyers&lt;BR /&gt;3069352    7en0fm          Mark Herman&lt;BR /&gt;2033224    wabtec          Wabtec sharedaccount&lt;BR /&gt;2032944    7e8e9u          Steven Dettloff&lt;BR /&gt;1966224    paez&lt;BR /&gt;1888472    mentordata&lt;BR /&gt;1810456    infodba         Iman Administrator&lt;BR /&gt;1650224    tek&lt;BR /&gt;1536368    reydl2          Matthew A Sawtell&lt;BR /&gt;1443248    redquest&lt;BR /&gt;1381032    nzr3k0          Nicholas Shim-Ping&lt;BR /&gt;103832     lzrxcl          Emma Biddings ---------------------------&amp;gt; First time &lt;BR /&gt;Emma Biddings ------------------------------------------------------&amp;gt; second time&lt;BR /&gt;6544       oracle          Oracle Administrator --------------------&amp;gt; First time&lt;BR /&gt;Oracle Administrator -----------------------------------------------&amp;gt; Second time&lt;BR /&gt;0          vz1fmk          Ish Patel&lt;BR /&gt;0          tzrrzp          Roopesh Shroff                      /emd/ansys2/tzrrzp&lt;BR /&gt;0          tpw                                                 /emd/tpw&lt;BR /&gt;0          tombers                                             /emd/ansys1/tombers&lt;BR /&gt;0          svihla          Gary Svihla                         /emd/ansys2/svihla&lt;BR /&gt;0          stdlib          Standards Coord CDMS                /users/stdlib&lt;BR /&gt;0          schueler                                            /emd/ansys2/schueler&lt;BR /&gt;0          rz17by          Maximo Test&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;C)I checked why they are comming two times:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) 103832     lzrxcl          Emma Biddings&lt;BR /&gt;Emma Biddings&lt;BR /&gt;&lt;BR /&gt;root@lgapps:/root &amp;gt; grep lzrxcl /etc/passwd&lt;BR /&gt;&lt;BR /&gt;lzrxcl:R1b5gn01B1VGU:1260:1002:Emma Biddings,,,:/emd/ansys2/lzrxcl:/usr/bin/sh&lt;BR /&gt;lzrxcl:R1b5gn01B1VGU:1260:1002:Emma Biddings,,,:/emd/ansys2/lzrxcl:/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2)6544       oracle          Oracle Administrator&lt;BR /&gt;Oracle Administrator&lt;BR /&gt;&lt;BR /&gt;root@lgapps:/root &amp;gt; grep ^oracle: /etc/passwd&lt;BR /&gt;&lt;BR /&gt;oracle:oAx6JjE54AHZw:498:1010:Oracle Administrator,,,:/appl/oracle/dba/admin:/usr/bin/sh&lt;BR /&gt;oracle:oAx6JjE54AHZw:498:1010:Oracle Administrator,,,:/appl/oracle/dba/admin:/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want only one entry for each directory.&lt;BR /&gt;&lt;BR /&gt;Pls find the attachment for clear details.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 May 2009 10:35:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177966#M459468</guid>
      <dc:creator>senthil_kumar_2</dc:creator>
      <dc:date>2009-05-29T10:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177967#M459469</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Can you attached it once again????&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sunny</description>
      <pubDate>Fri, 29 May 2009 10:56:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177967#M459469</guid>
      <dc:creator>Sunny123_1</dc:creator>
      <dc:date>2009-05-29T10:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177968#M459470</link>
      <description>&lt;!--!*#--&gt;&amp;gt;Pls find the attachment for clear details.&lt;BR /&gt;&lt;BR /&gt;Thanks, that solves the mystery:&lt;BR /&gt;givenname=$(grep "^$uname:" /etc/passwd |&lt;BR /&gt;   awk -F: 'NR == 1 { gsub(",", "", $5); print $5 }')&lt;BR /&gt;&lt;BR /&gt;(Or you could stick a "head -1" in the pipe.)</description>
      <pubDate>Fri, 29 May 2009 10:59:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177968#M459470</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-29T10:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177969#M459471</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;You can give head option in pipe like&lt;BR /&gt;&lt;BR /&gt;head -1 if you want only one entry.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sunny</description>
      <pubDate>Fri, 29 May 2009 11:02:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177969#M459471</guid>
      <dc:creator>Sunny123_1</dc:creator>
      <dc:date>2009-05-29T11:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to align the space between column in output of the script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177970#M459472</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Now everything is fine.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 May 2009 11:27:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-align-the-space-between-column-in-output-of-the-script/m-p/5177970#M459472</guid>
      <dc:creator>senthil_kumar_2</dc:creator>
      <dc:date>2009-05-29T11:27:06Z</dc:date>
    </item>
  </channel>
</rss>

