<?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: Script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889971#M704907</link>
    <description>I don't know about bash, but ksh has the following features:&lt;BR /&gt;&lt;BR /&gt;typeset -L var1 # var1 is Left-justified, remove leading spaces&lt;BR /&gt;typeset -R var2 # var2 is Right-justified, remove trailing spaces&lt;BR /&gt;typeset -L8 var3 # var3 is Left-justified, padded to 8 chars total, remove leading spaces&lt;BR /&gt;typeset -R9 var4 # var4 is Right-justified, padded to 9 chars total, remove trailing spaces</description>
    <pubDate>Mon, 07 Mar 2005 10:43:15 GMT</pubDate>
    <dc:creator>Gordon  Morrison_1</dc:creator>
    <dc:date>2005-03-07T10:43:15Z</dc:date>
    <item>
      <title>Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889967#M704903</link>
      <description>Hello,&lt;BR /&gt;I want to know what are the standart ways to format the output of the script?&lt;BR /&gt;&lt;BR /&gt;For explamle I need the following output:&lt;BR /&gt;&lt;BR /&gt;Mount              Size    Comments&lt;BR /&gt;/opt               345     Testing bla&lt;BR /&gt;/software/omni     8003    bla bla bla&lt;BR /&gt;&lt;BR /&gt;If I use printf(1) to format the output, it's only padding from the left and I need padding from the right, is there any way to tell printf to pad from the right?&lt;BR /&gt;&lt;BR /&gt;(I'm using onl bash, no perl, php etc ...)</description>
      <pubDate>Mon, 07 Mar 2005 10:34:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889967#M704903</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2005-03-07T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889968#M704904</link>
      <description>man adjust&lt;BR /&gt;adjust -r, else awk printf</description>
      <pubDate>Mon, 07 Mar 2005 10:36:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889968#M704904</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-03-07T10:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889969#M704905</link>
      <description>Not sure what layout you want, as the HP ITRC code strips away multiple spaces in your post.&lt;BR /&gt;&lt;BR /&gt;But the format argument of bash's printf allows for a '-' sign to indicate right alignment and a figure to indicate field width.&lt;BR /&gt;&lt;BR /&gt;Example&lt;BR /&gt;&lt;BR /&gt;bash$ printf "%14d\n" 12&lt;BR /&gt;............12&lt;BR /&gt;&lt;BR /&gt;AND&lt;BR /&gt;&lt;BR /&gt;bash$ printf "%-14d" 12&lt;BR /&gt;12............&lt;BR /&gt;&lt;BR /&gt;I've replaced the spaces with '.'s to show you what is happening.</description>
      <pubDate>Mon, 07 Mar 2005 10:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889969#M704905</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-03-07T10:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889970#M704906</link>
      <description>printf will pad in either direction. Some combination of the following example will work for you:&lt;BR /&gt;&lt;BR /&gt;printf "%20s%-20s%-20.20s\n" AA BB CC&lt;BR /&gt;&lt;BR /&gt;The "-" pads on the right, -20.20 pads on the right but also limits the total width of the field to 20 so that it can both pad and truncate.</description>
      <pubDate>Mon, 07 Mar 2005 10:41:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889970#M704906</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-07T10:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889971#M704907</link>
      <description>I don't know about bash, but ksh has the following features:&lt;BR /&gt;&lt;BR /&gt;typeset -L var1 # var1 is Left-justified, remove leading spaces&lt;BR /&gt;typeset -R var2 # var2 is Right-justified, remove trailing spaces&lt;BR /&gt;typeset -L8 var3 # var3 is Left-justified, padded to 8 chars total, remove leading spaces&lt;BR /&gt;typeset -R9 var4 # var4 is Right-justified, padded to 9 chars total, remove trailing spaces</description>
      <pubDate>Mon, 07 Mar 2005 10:43:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889971#M704907</guid>
      <dc:creator>Gordon  Morrison_1</dc:creator>
      <dc:date>2005-03-07T10:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889972#M704908</link>
      <description>thanx for the help!</description>
      <pubDate>Mon, 07 Mar 2005 12:05:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/4889972#M704908</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2005-03-07T12:05:39Z</dc:date>
    </item>
  </channel>
</rss>

