<?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: can not parser ~$user in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746385#M101508</link>
    <description>First problem is that you are apparently using the Korn shell. This doesn't happen in the POSIX shell, /usr/bin/sh, which is the standard HP-UX shell. :)</description>
    <pubDate>Tue, 07 Mar 2006 15:06:39 GMT</pubDate>
    <dc:creator>Jeff_Traigle</dc:creator>
    <dc:date>2006-03-07T15:06:39Z</dc:date>
    <item>
      <title>can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746384#M101507</link>
      <description>user=`whoami`&lt;BR /&gt; in my script, I have the following lines&lt;BR /&gt;  &lt;BR /&gt; for i in  `ls ~$user/.*table`&lt;BR /&gt;   do&lt;BR /&gt;      echo "Modifying $i now....."&lt;BR /&gt;      echo&lt;BR /&gt;   done&lt;BR /&gt;  &lt;BR /&gt;when I run it, it always put the ' ' around $user and gave the following errors&lt;BR /&gt;&lt;BR /&gt;++ ls '~anderson/.*table'&lt;BR /&gt; ls: ~anderson/.*table: No such file or directory&lt;BR /&gt;&lt;BR /&gt;If I do ls ~anderson/.*table, it gave desired output.&lt;BR /&gt;  &lt;BR /&gt;how do I get around the problem :-(&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thak you&lt;BR /&gt;&lt;BR /&gt;but, if I run manually like "ls ~yanga&lt;BR /&gt;&amp;gt;</description>
      <pubDate>Tue, 07 Mar 2006 14:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746384#M101507</guid>
      <dc:creator>Gemini_2</dc:creator>
      <dc:date>2006-03-07T14:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746385#M101508</link>
      <description>First problem is that you are apparently using the Korn shell. This doesn't happen in the POSIX shell, /usr/bin/sh, which is the standard HP-UX shell. :)</description>
      <pubDate>Tue, 07 Mar 2006 15:06:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746385#M101508</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-03-07T15:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746386#M101509</link>
      <description>Jeff is right.  It works in the POSIX shell but not the Korn shell.  The man pages for both shells seem to have the same description for tilde substitution, so my guess is that you've found a bug in HP-UX's version of the Korn shell.  &lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Mar 2006 15:13:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746386#M101509</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2006-03-07T15:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746387#M101510</link>
      <description>PHCO_33169 corrects some tidle related bugs in ksh for 11.11; since you didn't bother to identify your OS version, this may or may not be applicable. In any event, the use of ksh on HP-UX is somewhat discouraged as sh (the POSIX shell) is the default and I suspect gets much more rigorous testing than does ksh.</description>
      <pubDate>Tue, 07 Mar 2006 15:48:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746387#M101510</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-03-07T15:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746388#M101511</link>
      <description>Since the only workaround to your problem seems to be injecting the "eval" command in the for loop line, it looks like the shell isn't doing variable expansion before running the command. You can force it do so using eval...&lt;BR /&gt;&lt;BR /&gt;for i in `eval ls ~$user/.*table`&lt;BR /&gt;do&lt;BR /&gt;echo "Modifying $i now....."&lt;BR /&gt;echo&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;hope it helps!</description>
      <pubDate>Tue, 07 Mar 2006 15:55:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746388#M101511</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-03-07T15:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746389#M101512</link>
      <description>yes, "eval" did the trick!&lt;BR /&gt;&lt;BR /&gt;thank you</description>
      <pubDate>Tue, 07 Mar 2006 18:37:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746389#M101512</guid>
      <dc:creator>Gemini_2</dc:creator>
      <dc:date>2006-03-07T18:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746390#M101513</link>
      <description>Minor correction to my last post, the shell is doing variable expansion but not doing the filename metacharacter expansion. Since ~$user is the home directory of user "anderson" on your system, hence the shell needs to be forced to re-evaluate the command line before executing it. Otherwise the command tries to list all files named ".*table" under the sub-directory "~anderson".&lt;BR /&gt;&lt;BR /&gt;hope it helps!</description>
      <pubDate>Tue, 07 Mar 2006 19:54:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746390#M101513</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-03-07T19:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: can not parser ~$user</title>
      <link>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746391#M101514</link>
      <description>excellent explanation!!&lt;BR /&gt;&lt;BR /&gt;really appreciate!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Mar 2006 16:09:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/can-not-parser-user/m-p/3746391#M101514</guid>
      <dc:creator>Gemini_2</dc:creator>
      <dc:date>2006-03-08T16:09:12Z</dc:date>
    </item>
  </channel>
</rss>

