<?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: shell string manipulation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606990#M824263</link>
    <description>parameter substitution with an offset isn't implemented in hp-ux's usual shells, /usr/bin/sh and /usr/bin/ksh.  This has been implemented starting with ksh93 (so much for a modern programming environment). this syntax maybe implemented in the dtksh shell, /usr/dt/bin/dtksh.  otherwise you'll just have to use a shell that does implement it.&lt;BR /&gt;&lt;BR /&gt;but one way to get the first 10 characters would be to do something like this:&lt;BR /&gt;&lt;BR /&gt;typeset -L10 tmp10&lt;BR /&gt;&lt;BR /&gt;tmp10=$line&lt;BR /&gt;data=$tmp10&lt;BR /&gt;</description>
    <pubDate>Thu, 18 Aug 2005 14:10:29 GMT</pubDate>
    <dc:creator>curt larson_1</dc:creator>
    <dc:date>2005-08-18T14:10:29Z</dc:date>
    <item>
      <title>shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606984#M824257</link>
      <description>Hi, does anyone know how to make this work in hp-ux:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;line=...&lt;BR /&gt;data=${line:0:10}&lt;BR /&gt;&lt;BR /&gt;i'm getting this error:&lt;BR /&gt;./script: data=${line:0:10}: bad substitution&lt;BR /&gt;&lt;BR /&gt;but in linux works... does anyone knows an equivalent to hp-ux?&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2005 12:39:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606984#M824257</guid>
      <dc:creator>Ricardo_78</dc:creator>
      <dc:date>2005-08-18T12:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606985#M824258</link>
      <description>data=`echo $line |cut -c1-10`</description>
      <pubDate>Thu, 18 Aug 2005 12:41:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606985#M824258</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-08-18T12:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606986#M824259</link>
      <description>How does line look like and what you want to extract from it??</description>
      <pubDate>Thu, 18 Aug 2005 12:42:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606986#M824259</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-08-18T12:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606987#M824260</link>
      <description>data=`echo $line|cut -c1-10`</description>
      <pubDate>Thu, 18 Aug 2005 12:42:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606987#M824260</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-08-18T12:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606988#M824261</link>
      <description>sorry&lt;BR /&gt;data=`echo $line |cut -c1-11`</description>
      <pubDate>Thu, 18 Aug 2005 12:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606988#M824261</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-08-18T12:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606989#M824262</link>
      <description>if you prefer an awk solution. &lt;BR /&gt;&lt;BR /&gt;echo $line | awk '{print substr($0,0,10)}'&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2005 12:51:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606989#M824262</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2005-08-18T12:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606990#M824263</link>
      <description>parameter substitution with an offset isn't implemented in hp-ux's usual shells, /usr/bin/sh and /usr/bin/ksh.  This has been implemented starting with ksh93 (so much for a modern programming environment). this syntax maybe implemented in the dtksh shell, /usr/dt/bin/dtksh.  otherwise you'll just have to use a shell that does implement it.&lt;BR /&gt;&lt;BR /&gt;but one way to get the first 10 characters would be to do something like this:&lt;BR /&gt;&lt;BR /&gt;typeset -L10 tmp10&lt;BR /&gt;&lt;BR /&gt;tmp10=$line&lt;BR /&gt;data=$tmp10&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2005 14:10:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606990#M824263</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2005-08-18T14:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: shell string manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606991#M824264</link>
      <description>What's stored in line and what string manipulation are you trying on data? Appending a string or extracting a substring from it or other?? Please elaborate on what you are trying to get at.&lt;BR /&gt;&lt;BR /&gt;regards!</description>
      <pubDate>Thu, 18 Aug 2005 15:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-string-manipulation/m-p/3606991#M824264</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-08-18T15:52:53Z</dc:date>
    </item>
  </channel>
</rss>

