<?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 script output columns in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177927#M322007</link>
    <description>Does anyone know how to make these columns &lt;BR /&gt;come out striaght. Here is the output and&lt;BR /&gt;the code is below. I'm not much on tclsh.&lt;BR /&gt;&lt;BR /&gt;--------------&lt;BR /&gt;Count of problem log files during Email collection&lt;BR /&gt;&lt;BR /&gt;Tester          Site            Errors&lt;BR /&gt;&lt;BR /&gt;ats182          Irving          0&lt;BR /&gt;ats182          Seattle         0&lt;BR /&gt;ats182          BESC    0&lt;BR /&gt;ats182          EPSC    0&lt;BR /&gt;ats195          Seattle         0&lt;BR /&gt;ats195          BESC    0&lt;BR /&gt;ats195          Irving          0&lt;BR /&gt;ats195          ASPC    0&lt;BR /&gt;----------------------------&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# Comment with backslash required here. \&lt;BR /&gt;exec ${TCL_HOME}/bin/tclsh "$0" "$@"&lt;BR /&gt;set CB $env(CollectBox);&lt;BR /&gt;proc CountSite {Tester SubDir} {&lt;BR /&gt;   set Count [open "| find $SubDir -type f |&lt;BR /&gt;wc"];&lt;BR /&gt;   gets $Count cnt;&lt;BR /&gt;   close $Count;&lt;BR /&gt;   puts "$Tester   \t[file tail $SubDir]   \t[lindex $cnt 0]" ;&lt;BR /&gt;}&lt;BR /&gt;puts "\nCount of problem log files during Email collection\n";&lt;BR /&gt;puts "Tester\t\tSite   \t\tErrors\n";&lt;BR /&gt;foreach Tester [glob $CB/*] {&lt;BR /&gt;   if [file exists $Tester/Oops] {&lt;BR /&gt;      foreach SubDir [glob -nocomplain $Tester/Oops/TST/*] {&lt;BR /&gt;         CountSite [file tail $Tester] $SubDir;&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;}</description>
    <pubDate>Thu, 10 Apr 2008 15:44:20 GMT</pubDate>
    <dc:creator>jerry1</dc:creator>
    <dc:date>2008-04-10T15:44:20Z</dc:date>
    <item>
      <title>script output columns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177927#M322007</link>
      <description>Does anyone know how to make these columns &lt;BR /&gt;come out striaght. Here is the output and&lt;BR /&gt;the code is below. I'm not much on tclsh.&lt;BR /&gt;&lt;BR /&gt;--------------&lt;BR /&gt;Count of problem log files during Email collection&lt;BR /&gt;&lt;BR /&gt;Tester          Site            Errors&lt;BR /&gt;&lt;BR /&gt;ats182          Irving          0&lt;BR /&gt;ats182          Seattle         0&lt;BR /&gt;ats182          BESC    0&lt;BR /&gt;ats182          EPSC    0&lt;BR /&gt;ats195          Seattle         0&lt;BR /&gt;ats195          BESC    0&lt;BR /&gt;ats195          Irving          0&lt;BR /&gt;ats195          ASPC    0&lt;BR /&gt;----------------------------&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# Comment with backslash required here. \&lt;BR /&gt;exec ${TCL_HOME}/bin/tclsh "$0" "$@"&lt;BR /&gt;set CB $env(CollectBox);&lt;BR /&gt;proc CountSite {Tester SubDir} {&lt;BR /&gt;   set Count [open "| find $SubDir -type f |&lt;BR /&gt;wc"];&lt;BR /&gt;   gets $Count cnt;&lt;BR /&gt;   close $Count;&lt;BR /&gt;   puts "$Tester   \t[file tail $SubDir]   \t[lindex $cnt 0]" ;&lt;BR /&gt;}&lt;BR /&gt;puts "\nCount of problem log files during Email collection\n";&lt;BR /&gt;puts "Tester\t\tSite   \t\tErrors\n";&lt;BR /&gt;foreach Tester [glob $CB/*] {&lt;BR /&gt;   if [file exists $Tester/Oops] {&lt;BR /&gt;      foreach SubDir [glob -nocomplain $Tester/Oops/TST/*] {&lt;BR /&gt;         CountSite [file tail $Tester] $SubDir;&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;}</description>
      <pubDate>Thu, 10 Apr 2008 15:44:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177927#M322007</guid>
      <dc:creator>jerry1</dc:creator>
      <dc:date>2008-04-10T15:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: script output columns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177928#M322008</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;If I understand your question correctly,&lt;BR /&gt;you want to format the output from the&lt;BR /&gt;script execution.&lt;BR /&gt;&lt;BR /&gt;Then, you do not use command puts alone but add&lt;BR /&gt;format to it. Something like:&lt;BR /&gt;&lt;BR /&gt;puts [format "%7s\t%10s\t%s\n" $Tester $[file tail $SubDir] $[lindex $cnt 0]]&lt;BR /&gt;&lt;BR /&gt;The format command returns a string that is&lt;BR /&gt;sent to the standard output device with the&lt;BR /&gt;puts command.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Apr 2008 20:49:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177928#M322008</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-04-10T20:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: script output columns</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177929#M322009</link>
      <description>Thanks, that looks better. I could not find&lt;BR /&gt;any man tclsh reference to "format". Do you&lt;BR /&gt;know where this is documented. Also, I had&lt;BR /&gt;to take out the $'s next to [file and &lt;BR /&gt;[lindex you had or it would print $'s next &lt;BR /&gt;to the output value. I just have to work on&lt;BR /&gt;the header columns now.&lt;BR /&gt;&lt;BR /&gt;puts [format "%7s\t%10s\t%s\n" $Tester  [file tail $SubDir]  [lindex $cnt 0]] ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Tester  Site Oopsies&lt;BR /&gt;&lt;BR /&gt; ats182     Irving      0&lt;BR /&gt;&lt;BR /&gt; ats182    Seattle      0&lt;BR /&gt;&lt;BR /&gt; ats182       BESC      0&lt;BR /&gt;&lt;BR /&gt; ats182       EPSC      0&lt;BR /&gt;&lt;BR /&gt; ats195    Seattle      0&lt;BR /&gt;&lt;BR /&gt; ats195       BESC      0&lt;BR /&gt;&lt;BR /&gt; ats195     Irving      0</description>
      <pubDate>Fri, 11 Apr 2008 13:32:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output-columns/m-p/4177929#M322009</guid>
      <dc:creator>jerry1</dc:creator>
      <dc:date>2008-04-11T13:32:33Z</dc:date>
    </item>
  </channel>
</rss>

