<?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 echo question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025525#M131444</link>
    <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I am using echo "\a\nancy\file" but the echo output I get is following..&lt;BR /&gt;&lt;BR /&gt;echo "\a\nancy\file"&lt;BR /&gt;&lt;BR /&gt;ancy&lt;BR /&gt;    ile&lt;BR /&gt;&lt;BR /&gt;Because \ is a speacial charactor for new line, any idea how to solve this, I want the output of echo would be same as \a\nancy\file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Anthony&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 16 Jul 2003 14:47:57 GMT</pubDate>
    <dc:creator>Anthony khan</dc:creator>
    <dc:date>2003-07-16T14:47:57Z</dc:date>
    <item>
      <title>echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025525#M131444</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I am using echo "\a\nancy\file" but the echo output I get is following..&lt;BR /&gt;&lt;BR /&gt;echo "\a\nancy\file"&lt;BR /&gt;&lt;BR /&gt;ancy&lt;BR /&gt;    ile&lt;BR /&gt;&lt;BR /&gt;Because \ is a speacial charactor for new line, any idea how to solve this, I want the output of echo would be same as \a\nancy\file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Anthony&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jul 2003 14:47:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025525#M131444</guid>
      <dc:creator>Anthony khan</dc:creator>
      <dc:date>2003-07-16T14:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025526#M131445</link>
      <description>\n is a special code for the printf command, not the echo command. That's why it does not work.&lt;BR /&gt;&lt;BR /&gt;man printf&lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Wed, 16 Jul 2003 14:49:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025526#M131445</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2003-07-16T14:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025527#M131446</link>
      <description>Hi Anthony:&lt;BR /&gt;&lt;BR /&gt;# echo '\\a\\nancy\\file'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 16 Jul 2003 14:54:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025527#M131446</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-07-16T14:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025528#M131447</link>
      <description>try&lt;BR /&gt;&lt;BR /&gt;echo '\\a\\nancy\\file'&lt;BR /&gt;&lt;BR /&gt;works for me.  you need to excape the \a the \n and the \f&lt;BR /&gt;the escape character is \</description>
      <pubDate>Wed, 16 Jul 2003 14:58:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025528#M131447</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-07-16T14:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025529#M131448</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You'll need to escape the backslashes with a backslash, ie:&lt;BR /&gt;&lt;BR /&gt;echo "\\a\\nancy\\file"&lt;BR /&gt;&lt;BR /&gt;You may want to use something like sed to automate this if you've got a lot of these to change ;)&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren.</description>
      <pubDate>Wed, 16 Jul 2003 15:02:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025529#M131448</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2003-07-16T15:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025530#M131449</link>
      <description>looks like my first reply never made it, so I'll try again&lt;BR /&gt;&lt;BR /&gt;you really should be using the "print" command as echo is obsolete.  echo and print formats several escape conventions including:&lt;BR /&gt;\a bell character&lt;BR /&gt;\n newline&lt;BR /&gt;\f formfeed&lt;BR /&gt;and&lt;BR /&gt;\\ backslash&lt;BR /&gt;&lt;BR /&gt;with the echo command your stuck with using \\ for a backslash.  with the print command you can also use the -R and -r switches which do not use the \ conventions.&lt;BR /&gt;&lt;BR /&gt;and if your shell has a printf command you can also use or not use the \ conventions depending on your conversion specification (%s or %b).</description>
      <pubDate>Wed, 16 Jul 2003 15:13:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025530#M131449</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-16T15:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025531#M131450</link>
      <description>Hi (again) Anthony:&lt;BR /&gt;&lt;BR /&gt;Curt's suggestion to use the 'print -R' syntax is the most direct answer to your problem.  This is documented in the man pages for 'sh-posix'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jul 2003 15:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025531#M131450</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-07-16T15:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025532#M131451</link>
      <description>Its working now only thing is left is using sed to change \a\nancy\file to \\a\\nancy\file, can anyone help...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 16 Jul 2003 15:57:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025532#M131451</guid>
      <dc:creator>Anthony khan</dc:creator>
      <dc:date>2003-07-16T15:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025533#M131452</link>
      <description>cat mjk-test&lt;BR /&gt;\a\nancy\file&lt;BR /&gt;&lt;BR /&gt;cat mjk-test | sed -e 's/\\/\\\\/g'&lt;BR /&gt;\\a\\nancy\\file&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Michael.</description>
      <pubDate>Wed, 16 Jul 2003 16:06:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025533#M131452</guid>
      <dc:creator>Michael Kelly_5</dc:creator>
      <dc:date>2003-07-16T16:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025534#M131453</link>
      <description>or even this if you really want only one \ before the f.&lt;BR /&gt;&lt;BR /&gt;cat mjk-test | sed -e 's/\\a/\\\\a/' -e 's/\\n/\\\\n/'&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Michael.</description>
      <pubDate>Wed, 16 Jul 2003 16:11:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025534#M131453</guid>
      <dc:creator>Michael Kelly_5</dc:creator>
      <dc:date>2003-07-16T16:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: echo question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025535#M131454</link>
      <description>a="\a\nancy\file"&lt;BR /&gt;&lt;BR /&gt;echo $(print -r $a | sed 's|\\|\\\\|g')&lt;BR /&gt;# this will work just as well (actually better)&lt;BR /&gt;&lt;BR /&gt;print -r $a&lt;BR /&gt;&lt;BR /&gt;#if you're using the korn shell you can also do&lt;BR /&gt;&lt;BR /&gt;printf "%s" $a&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jul 2003 16:26:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-question/m-p/3025535#M131454</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-16T16:26:13Z</dc:date>
    </item>
  </channel>
</rss>

