<?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: AWK script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271243#M655992</link>
    <description>Hello Dennis,&lt;BR /&gt;your suggestion works correctly.&lt;BR /&gt;I found a mistake in the ShellEncrypt.sh script.&lt;BR /&gt;&lt;BR /&gt;I corrected it and now it works.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 24 Jan 2011 12:14:58 GMT</pubDate>
    <dc:creator>gaudiobe</dc:creator>
    <dc:date>2011-01-24T12:14:58Z</dc:date>
    <item>
      <title>AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271240#M655989</link>
      <description>&lt;!--!*#--&gt;Hello to all,&lt;BR /&gt;I created an awk script long time ago, now i need to modify this script inserting a new operationinside it.&lt;BR /&gt;&lt;BR /&gt;the source file is something like this:&lt;BR /&gt;adjksfhluawe='string1_to_encrypt'afjskdasndkajcfc&lt;BR /&gt;asjrhquwerfb='string2_to_encrypt'sfjsejkbghbvzjhs&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;The new command porpose is to encrypt a string inside the original file.&lt;BR /&gt;&lt;BR /&gt;I have already created an external shell script that allow me to encrypt the string.&lt;BR /&gt;The shell script work like this:&lt;BR /&gt;ShellEncrypt.sh string_to_encrypt&lt;BR /&gt;The output of the script will bee an ecrypted same size string.&lt;BR /&gt;eg. &lt;BR /&gt;ShellEncrypt.sh text&lt;BR /&gt;the output of the file will be a string like:&lt;BR /&gt;A3rA&lt;BR /&gt;&lt;BR /&gt;I tried to use the system function inside the awk script and this partially works.&lt;BR /&gt;&lt;BR /&gt;Will follow my awk program:&lt;BR /&gt;&lt;BR /&gt;prog.awk script:&lt;BR /&gt;#########################&lt;BR /&gt;BEGIN { FS = "'" }&lt;BR /&gt;$0 ~ /'/   {&lt;BR /&gt;            printf ($1 "'");&lt;BR /&gt;            system("ShellEncrypt.sh "$2"");&lt;BR /&gt;            printf ("'" $3);&lt;BR /&gt;            }&lt;BR /&gt;#########################&lt;BR /&gt;&lt;BR /&gt;and awk command line:&lt;BR /&gt;# awk -f prog.awk source.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Unfortunately the result will be not the expected one because after the ecryption of the string with the system command &lt;BR /&gt;I have the following output:&lt;BR /&gt;adjksfhluawe='ecrypted_string_1_&lt;BR /&gt;'afjskdasndkajcfc&lt;BR /&gt;asjrhquwerfb='ecrypted_string_2_&lt;BR /&gt;'sfjsejkbghbvzjhs&lt;BR /&gt;&lt;BR /&gt;Instead my expected output was:&lt;BR /&gt;adjksfhluawe='ecrypted_string_1_'afjskdasndkajcfc&lt;BR /&gt;asjrhquwerfb='ecrypted_string_2_'sfjsejkbghbvzjhs&lt;BR /&gt;&lt;BR /&gt;Can you help me to find a solution?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;Regards&lt;BR /&gt;Bernardo</description>
      <pubDate>Mon, 24 Jan 2011 09:19:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271240#M655989</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2011-01-24T09:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271241#M655990</link>
      <description>Your script also prints out a newline.&lt;BR /&gt;You might be able to suppress it with:&lt;BR /&gt;system("X=$(ShellEncrypt.sh " $2 "); echo $X\\c")&lt;BR /&gt;(You may have to add more backslashes.)</description>
      <pubDate>Mon, 24 Jan 2011 11:19:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271241#M655990</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-24T11:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271242#M655991</link>
      <description>&lt;!--!*#--&gt;I tryed the solution suggested but it does not fix my problem.&lt;BR /&gt;&lt;BR /&gt;for example:&lt;BR /&gt;result expected:&lt;BR /&gt;adjksfhluawe='ecrypted_string_1_'afjskdasndkajcfc&lt;BR /&gt;&lt;BR /&gt;test 1&lt;BR /&gt;system("X=$(ShellEncrypt.sh " $2 "); echo $X\\c"&lt;BR /&gt;&lt;BR /&gt;result:&lt;BR /&gt;adjksfhluawe='ecrypted_string_c_&lt;BR /&gt;'afjskdasndkajcfc&lt;BR /&gt;&lt;BR /&gt;test 2&lt;BR /&gt;system("X=$(ShellEncrypt.sh " $2 "); echo $X\\\c"&lt;BR /&gt;&lt;BR /&gt;result:&lt;BR /&gt;adjksfhluawe='ecrypted_string_'afjskdasndkajcfc&lt;BR /&gt;&lt;BR /&gt;test 3&lt;BR /&gt;system("X=$(ShellEncrypt.sh " $2 "); echo $X\\\\c"&lt;BR /&gt;&lt;BR /&gt;result:&lt;BR /&gt;adjksfhluawe='ecrypted_string_'afjskdasndkajcfc&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jan 2011 11:42:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271242#M655991</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2011-01-24T11:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271243#M655992</link>
      <description>Hello Dennis,&lt;BR /&gt;your suggestion works correctly.&lt;BR /&gt;I found a mistake in the ShellEncrypt.sh script.&lt;BR /&gt;&lt;BR /&gt;I corrected it and now it works.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jan 2011 12:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271243#M655992</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2011-01-24T12:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271244#M655993</link>
      <description>&amp;gt;but it does not fix my problem.&lt;BR /&gt;adjksfhluawe='ecrypted_string_'afjskdasndkajcfc&lt;BR /&gt;adjksfhluawe='ecrypted_string_1_'afjskdasndkajcfc&lt;BR /&gt;&lt;BR /&gt;You need to explain why these aren't the same?  (I assumed these were produced by your script.)&lt;BR /&gt;Do you want the awk script to number each output with "_N_"?</description>
      <pubDate>Mon, 24 Jan 2011 12:18:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271244#M655993</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-24T12:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271245#M655994</link>
      <description>&lt;!--!*#--&gt;Hello Dennis,&lt;BR /&gt;Sorry for the previous reply.&lt;BR /&gt;Your suggestion works correctly.&lt;BR /&gt;I found a mistake in the ShellEncrypt.sh script.&lt;BR /&gt;&lt;BR /&gt;I corrected it and now it works.</description>
      <pubDate>Mon, 24 Jan 2011 12:56:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271245#M655994</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2011-01-24T12:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: AWK script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271246#M655995</link>
      <description>As suggested by Dennis I used:&lt;BR /&gt;system("X=$(ShellEncrypt.sh " $2 "); echo $X\\\c")&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Bernardo&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jan 2011 12:58:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script/m-p/5271246#M655995</guid>
      <dc:creator>gaudiobe</dc:creator>
      <dc:date>2011-01-24T12:58:27Z</dc:date>
    </item>
  </channel>
</rss>

