<?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 command usage in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999325#M914101</link>
    <description>No, Still it is not working by doing &lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " " | sed s/^$//g&lt;BR /&gt;&lt;BR /&gt;sed only removes all the blank lines .. and doesn't  make any sense here.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Karthik</description>
    <pubDate>Tue, 17 Jun 2003 10:48:47 GMT</pubDate>
    <dc:creator>Karthik S S</dc:creator>
    <dc:date>2003-06-17T10:48:47Z</dc:date>
    <item>
      <title>Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999323#M914099</link>
      <description>Hi, I have a file hpux25.tmp which contains the following entries,&lt;BR /&gt;&lt;BR /&gt;cat hpux25.tmp&lt;BR /&gt;----------------------------------------&lt;BR /&gt;Time: Fri May 30 23:13:53 2003   ID: hpux25_1054316633   FULL (0)&lt;BR /&gt;Time: Sat May 17 02:32:53 2003   ID: hpux25_1053118973   FULL (0)&lt;BR /&gt;Time: Tue Jun 10 20:24:58 2003   ID: hpux25_1055256898   FULL (0)&lt;BR /&gt;Time: Sun Jun 08 20:01:13 2003   ID: hpux25_1055082673   FULL (0)&lt;BR /&gt;Time: Fri Jun 06 20:26:37 2003   ID: hpux25_1054911397   FULL (0)&lt;BR /&gt;Time: Tue Jun 03 20:24:24 2003   ID: hpux25_1054652064   FULL (0)&lt;BR /&gt;Time: Mon Jun 02 16:25:39 2003   ID: hpux25_1054551339   FULL (0)&lt;BR /&gt;Time: Fri May 30 20:53:04 2003   ID: hpux25_1054308184   FULL (0)&lt;BR /&gt;Time: Thu May 29 23:35:54 2003   ID: hpux25_1054231554   FULL (0)&lt;BR /&gt;Time: Thu May 29 22:18:04 2003   ID: hpux25_1054226884   FULL (0)&lt;BR /&gt;Time: Thu May 29 21:27:02 2003   ID: hpux25_1054223822   FULL (0)&lt;BR /&gt;Time: Tue May 27 20:23:16 2003   ID: hpux25_1054047196   FULL (0)&lt;BR /&gt;Time: Sun May 25 20:00:06 2003   ID: hpux25_1053873006   FULL (0)&lt;BR /&gt;Time: Fri May 23 20:32:16 2003   ID: hpux25_1053702136   FULL (0)&lt;BR /&gt;Time: Tue May 20 20:30:12 2003   ID: hpux25_1053442812   FULL (0)&lt;BR /&gt;Time: Sun May 18 19:58:26 2003   ID: hpux25_1053268106   FULL (0)&lt;BR /&gt;----------------------------------------&lt;BR /&gt;&lt;BR /&gt;And I have a written asmall script like this,&lt;BR /&gt;cat script1.sh&lt;BR /&gt;----------------------------------------&lt;BR /&gt;Jan=1&lt;BR /&gt;Feb=2&lt;BR /&gt;Mar=3&lt;BR /&gt;Apr=4&lt;BR /&gt;May=5&lt;BR /&gt;Jun=6&lt;BR /&gt;Jul=7&lt;BR /&gt;Aug=8&lt;BR /&gt;Sep=9&lt;BR /&gt;Oct=10&lt;BR /&gt;Nov=11&lt;BR /&gt;Dec=12&lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " " | sed s/^/$/g `&lt;BR /&gt;do&lt;BR /&gt;echo "$i"&lt;BR /&gt;done&lt;BR /&gt;----------------------------------------&lt;BR /&gt;&lt;BR /&gt;But when I do a echo $i inside the script it echoes merely for ex: $May instead of showing its value which is set to 5.&lt;BR /&gt;&lt;BR /&gt;What could be the problem??&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Karthik</description>
      <pubDate>Tue, 17 Jun 2003 10:34:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999323#M914099</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2003-06-17T10:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999324#M914100</link>
      <description>You have a littel type in your for statement.&lt;BR /&gt;&lt;BR /&gt;Do&lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " " | sed s/^$//g `&lt;BR /&gt;&lt;BR /&gt;instead of &lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " " | sed s/^/$/g `&lt;BR /&gt;&lt;BR /&gt;then it works.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;  Roland</description>
      <pubDate>Tue, 17 Jun 2003 10:43:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999324#M914100</guid>
      <dc:creator>RolandH</dc:creator>
      <dc:date>2003-06-17T10:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999325#M914101</link>
      <description>No, Still it is not working by doing &lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " " | sed s/^$//g&lt;BR /&gt;&lt;BR /&gt;sed only removes all the blank lines .. and doesn't  make any sense here.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Karthik</description>
      <pubDate>Tue, 17 Jun 2003 10:48:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999325#M914101</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2003-06-17T10:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999326#M914102</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This is normal, because each line is evaluated before execution :&lt;BR /&gt;&lt;BR /&gt;so you should rather use instead of &lt;BR /&gt;&lt;BR /&gt;echo "$i" evaluated to echo "May" BEFORE execution&lt;BR /&gt;&lt;BR /&gt;eval echo "\$$i", first evaluated to :&lt;BR /&gt;&lt;BR /&gt;echo "$May" then evaluated to 5 ...&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 17 Jun 2003 11:07:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999326#M914102</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-17T11:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999327#M914103</link>
      <description>Hi Jean,&lt;BR /&gt;&lt;BR /&gt;The following worked perfectly,&lt;BR /&gt;&lt;BR /&gt;for i in `cat cbin-nmvob1.tmp |cut -f3 -d " " | sed s/^/$/g `&lt;BR /&gt;do&lt;BR /&gt;eval echo "$i"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot,&lt;BR /&gt;Karthik S S</description>
      <pubDate>Tue, 17 Jun 2003 11:17:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999327#M914103</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2003-06-17T11:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999328#M914104</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;I agree with Jean-Louis - you must use eval.&lt;BR /&gt;&lt;BR /&gt;Try the following:&lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " "`&lt;BR /&gt;do&lt;BR /&gt;j='$'$i&lt;BR /&gt;eval "k=$j"&lt;BR /&gt;echo "$k"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ollie.</description>
      <pubDate>Tue, 17 Jun 2003 11:17:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999328#M914104</guid>
      <dc:creator>Ollie R</dc:creator>
      <dc:date>2003-06-17T11:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999329#M914105</link>
      <description>Sorry I read question to fast and did not recognize that you want the number instead of the month only.&lt;BR /&gt;&lt;BR /&gt;I have solved it like that way:&lt;BR /&gt;Jan=1 &lt;BR /&gt;Feb=2 &lt;BR /&gt;Mar=3 &lt;BR /&gt;Apr=4 &lt;BR /&gt;May=5 &lt;BR /&gt;Jun=6 &lt;BR /&gt;Jul=7 &lt;BR /&gt;Aug=8 &lt;BR /&gt;Sep=9 &lt;BR /&gt;Oct=10 &lt;BR /&gt;Nov=11 &lt;BR /&gt;Dec=12 &lt;BR /&gt;&lt;BR /&gt;for i in `cat hpux25.tmp |cut -f3 -d " " | sed s/^/$/g ` &lt;BR /&gt;do&lt;BR /&gt;SIGN='$' &lt;BR /&gt;eval echo ${SIGN}${i} &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt; Roland&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Jun 2003 11:17:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999329#M914105</guid>
      <dc:creator>RolandH</dc:creator>
      <dc:date>2003-06-17T11:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999330#M914106</link>
      <description>a possibly easier way to change the date is to change the way the script or system reports the date.  &lt;BR /&gt;&lt;BR /&gt;using %m as an option with date&lt;BR /&gt;&lt;BR /&gt;date "+%m/%d/%y"&lt;BR /&gt;&lt;BR /&gt;or by&lt;BR /&gt;&lt;BR /&gt;date -u mmddccyy</description>
      <pubDate>Tue, 17 Jun 2003 11:26:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999330#M914106</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-17T11:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999331#M914107</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;When I pass two fields to the cut command I get the o/p like this,&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;for i in `cat cbin-nmvob1.tmp |cut -f3,4 -d " " | sed s/^/$/g `&lt;BR /&gt;do&lt;BR /&gt;eval echo "$i"&lt;BR /&gt;done&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;&lt;BR /&gt;5&lt;BR /&gt;30&lt;BR /&gt;5&lt;BR /&gt;17&lt;BR /&gt;6&lt;BR /&gt;10&lt;BR /&gt;6&lt;BR /&gt;08&lt;BR /&gt;6&lt;BR /&gt;06&lt;BR /&gt;--- part o/p is truncated ---&lt;BR /&gt;&lt;BR /&gt;But I am expecting the o/p like this,&lt;BR /&gt;5 30&lt;BR /&gt;5 17&lt;BR /&gt;6 10&lt;BR /&gt;6 08&lt;BR /&gt;6 06&lt;BR /&gt;&lt;BR /&gt;How can I achieve this??&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Karthik</description>
      <pubDate>Tue, 17 Jun 2003 11:28:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999331#M914107</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2003-06-17T11:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999332#M914108</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This one should work (but I didn't test it ...)&lt;BR /&gt;&lt;BR /&gt;for i in `cat cbin-nmvob1.tmp |cut -f3,4 -d " " | sed s/^/$/g | tr ' ' '_'`&lt;BR /&gt;do&lt;BR /&gt;M=$(echo $i | cut -f1 -d'_')&lt;BR /&gt;D=$(echo $i | cut -f2 -d'_')&lt;BR /&gt;echo x"$(eval echo "$M") $D&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 17 Jun 2003 11:39:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999332#M914108</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-17T11:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999333#M914109</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This one should work (but I didn't test it ...)&lt;BR /&gt;&lt;BR /&gt;for i in `cat cbin-nmvob1.tmp |cut -f3,4 -d " " | sed s/^/$/g | tr ' ' '_'`&lt;BR /&gt;do&lt;BR /&gt;M=$(echo $i | cut -f1 -d'_')&lt;BR /&gt;D=$(echo $i | cut -f2 -d'_')&lt;BR /&gt;echo "$(eval echo "$M") $D&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 17 Jun 2003 11:39:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999333#M914109</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-17T11:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999334#M914110</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This one should work (but I didn't test it ...)&lt;BR /&gt;&lt;BR /&gt;for i in `cat cbin-nmvob1.tmp |cut -f3,4 -d " " | sed s/^/$/g | tr ' ' '_'`&lt;BR /&gt;do&lt;BR /&gt;M=$(echo $i | cut -f1 -d'_')&lt;BR /&gt;D=$(echo $i | cut -f2 -d'_')&lt;BR /&gt;echo $(eval echo "$M") $D&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 17 Jun 2003 11:40:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999334#M914110</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-17T11:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999335#M914111</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;The best way is to read each line individually using a construct similar to:&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE&gt; | while read LINE&lt;BR /&gt;do&lt;BR /&gt;   &lt;EXTRACT data="https://community.hpe.com/" for="" this="" line="" and="" process=""&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ollie.&lt;/EXTRACT&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 17 Jun 2003 11:40:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999335#M914111</guid>
      <dc:creator>Ollie R</dc:creator>
      <dc:date>2003-06-17T11:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999336#M914112</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;The best way is to read each line individually using a construct similar to:&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE&gt; | while read LINE&lt;BR /&gt;do&lt;BR /&gt;   &lt;EXTRACT data="https://community.hpe.com/" for=""&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ollie.&lt;/EXTRACT&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 17 Jun 2003 11:40:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999336#M914112</guid>
      <dc:creator>Ollie R</dc:creator>
      <dc:date>2003-06-17T11:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Echo command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999337#M914113</link>
      <description>You need a loop as follows,...&lt;BR /&gt;&lt;BR /&gt;echo /tmp/file |sed 'etc etc etc' &amp;gt;/tmp/inputfile&lt;BR /&gt;&lt;BR /&gt;while read a b &lt;BR /&gt;do&lt;BR /&gt;# a = first argument&lt;BR /&gt;# b = second argument&lt;BR /&gt;eval echo "$a $b"&lt;BR /&gt;&lt;BR /&gt;done &lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Tue, 17 Jun 2003 11:45:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-command-usage/m-p/2999337#M914113</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2003-06-17T11:45:58Z</dc:date>
    </item>
  </channel>
</rss>

