<?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: Echo and execute a command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500613#M728451</link>
    <description>What about plain old 'set -v' this will echo all commands before execution.</description>
    <pubDate>Tue, 13 Mar 2001 09:31:08 GMT</pubDate>
    <dc:creator>Tom Rosenfeld</dc:creator>
    <dc:date>2001-03-13T09:31:08Z</dc:date>
    <item>
      <title>Echo and execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500610#M728448</link>
      <description>Inside a Unix script, is there a way of echoing and executing a Unix command in a single line?</description>
      <pubDate>Fri, 02 Mar 2001 22:00:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500610#M728448</guid>
      <dc:creator>Ed Hon</dc:creator>
      <dc:date>2001-03-02T22:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Echo and execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500611#M728449</link>
      <description>Ed :&lt;BR /&gt;   &lt;BR /&gt; #!/usr/bin/sh&lt;BR /&gt; echo date | sh&lt;BR /&gt;&lt;BR /&gt;...Madhu&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Mar 2001 22:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500611#M728449</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2001-03-02T22:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Echo and execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500612#M728450</link>
      <description>Perhaps what is needed is a way to show a command then show the results.  How about something like:&lt;BR /&gt;&lt;BR /&gt;CMD="vgdisplay -v | grep -i name | grep -iv lv"&lt;BR /&gt;echo "$CMD \n\n$(eval $CMD)"&lt;BR /&gt;&lt;BR /&gt;Change the last value from lv to pv:&lt;BR /&gt;&lt;BR /&gt;CMD="vgdisplay -v | grep -i name | grep -iv pv"&lt;BR /&gt;echo "$CMD \n\n$(eval $CMD)"&lt;BR /&gt;&lt;BR /&gt;I use this technique to document inventory scripts that report on system components. That way, when someone notices an interesting listing, they don't have to ask "How'd you do that?"&lt;BR /&gt;&lt;BR /&gt;The string of command(s) can contain variables so you can even customize the command, document it and then run it.&lt;BR /&gt;&lt;BR /&gt;BTW: The above 2 command strings do a great job in laying out LVM structures in an easy to read format.&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Mar 2001 02:51:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500612#M728450</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-03-03T02:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Echo and execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500613#M728451</link>
      <description>What about plain old 'set -v' this will echo all commands before execution.</description>
      <pubDate>Tue, 13 Mar 2001 09:31:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500613#M728451</guid>
      <dc:creator>Tom Rosenfeld</dc:creator>
      <dc:date>2001-03-13T09:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Echo and execute a command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500614#M728452</link>
      <description>Just another option for you to consider, do nothing to your script but run shell with the -x switch,&lt;BR /&gt;&lt;BR /&gt;eg 1.  &lt;BR /&gt;ksh -x &lt;YOUR_SCRIPT&gt;&lt;/YOUR_SCRIPT&gt;&lt;BR /&gt;eg 2.&lt;BR /&gt;sh -x &lt;YOUR_SCRIPT&gt;&lt;/YOUR_SCRIPT&gt;&lt;BR /&gt;This way the command being executed will be printed out first then follow by the actual execution.</description>
      <pubDate>Tue, 13 Mar 2001 10:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-and-execute-a-command/m-p/2500614#M728452</guid>
      <dc:creator>Philip Chan_1</dc:creator>
      <dc:date>2001-03-13T10:08:44Z</dc:date>
    </item>
  </channel>
</rss>

