<?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: which command error, need help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694474#M612499</link>
    <description>&amp;gt;My which command is failing recently because of this error:&lt;BR /&gt;&lt;BR /&gt;Any reason you are using the scummy C shell or one if its utilities?&lt;BR /&gt;The real shell has "whence".</description>
    <pubDate>Mon, 04 Oct 2010 11:12:17 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2010-10-04T11:12:17Z</dc:date>
    <item>
      <title>which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694468#M612493</link>
      <description>My which command is failing recently because of this error:&lt;BR /&gt;&lt;BR /&gt;prompt@localhost&amp;gt;which&lt;BR /&gt;which[7]: Syntax error at line 7 : `(' is not expected.&lt;BR /&gt;&lt;BR /&gt;I don't why, but already looked into other HP-UX servers with working "which" commands but the script is just the same. &lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/csh&lt;BR /&gt;# @(#) $Revision: 72.1 $&lt;BR /&gt;#&lt;BR /&gt;#       which : tells you which program you get&lt;BR /&gt;#&lt;BR /&gt;set noglob&lt;BR /&gt;foreach arg ( $argv )&lt;BR /&gt;    set alius = `alias $arg`&lt;BR /&gt;    switch ( $#alius )&lt;BR /&gt;        case 0 :&lt;BR /&gt;            breaksw&lt;BR /&gt;        case 1 :&lt;BR /&gt;            set arg = $alius[1]&lt;BR /&gt;            breaksw&lt;BR /&gt;        default :&lt;BR /&gt;            echo ${arg}: "      " aliased to $alius&lt;BR /&gt;            continue&lt;BR /&gt;    endsw&lt;BR /&gt;    unset found&lt;BR /&gt;    if ( $arg:h != $arg:t ) then&lt;BR /&gt;        if ( -e $arg ) then&lt;BR /&gt;            echo $arg&lt;BR /&gt;        else&lt;BR /&gt;            echo $arg not found&lt;BR /&gt;        endif&lt;BR /&gt;        continue&lt;BR /&gt;    else&lt;BR /&gt;        foreach i ( $path )&lt;BR /&gt;            if ( -x $i/$arg &amp;amp;&amp;amp; ! -d $i/$arg ) then&lt;BR /&gt;                echo $i/$arg&lt;BR /&gt;                set found&lt;BR /&gt;                break&lt;BR /&gt;            endif&lt;BR /&gt;        end&lt;BR /&gt;    endif&lt;BR /&gt;    if ( ! $?found ) then&lt;BR /&gt;        echo no $arg in $path&lt;BR /&gt;    endif&lt;BR /&gt;end&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What seems to be the problem in here and how can i fix it? Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 09:09:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694468#M612493</guid>
      <dc:creator>sysad1_1</dc:creator>
      <dc:date>2010-10-04T09:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694469#M612494</link>
      <description>&lt;!--!*#--&gt;it's as if your script is interpreted by a sh-like shell (sh, ksh...) instead of /usr/bin/csh.&lt;BR /&gt;Try this to confirm:&lt;BR /&gt;$ sh /usr/bin/which&lt;BR /&gt;$ csh /usr/bin/which&lt;BR /&gt;&lt;BR /&gt;Can you check that your csh has not changed (or replaced by another thing).&lt;BR /&gt;&lt;BR /&gt;What is the result of:&lt;BR /&gt;$ what /usr/bin/csh&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mounaam</description>
      <pubDate>Mon, 04 Oct 2010 09:34:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694469#M612494</guid>
      <dc:creator>Mounaam</dc:creator>
      <dc:date>2010-10-04T09:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694470#M612495</link>
      <description>here are the command outputs you requested:&lt;BR /&gt;&lt;BR /&gt;# sh /usr/bin/which&lt;BR /&gt;/usr/bin/which[7]: Syntax error at line 7 : `(' is not expected.&lt;BR /&gt;# csh /usr/bin/which&lt;BR /&gt;sh: csh: Execute permission denied.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# what /usr/bin/csh&lt;BR /&gt;/usr/bin/csh:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 10:12:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694470#M612495</guid>
      <dc:creator>sysad1_1</dc:creator>
      <dc:date>2010-10-04T10:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694471#M612496</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; sh: csh: Execute permission denied.&lt;BR /&gt;&lt;BR /&gt;It looks like you don't have execute permissions.  This should look like:&lt;BR /&gt;&lt;BR /&gt;# -r-xr-xr-x   1 bin        bin            654 Feb 15  2007 /usr/bin/which&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 04 Oct 2010 10:43:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694471#M612496</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-10-04T10:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694472#M612497</link>
      <description>Check it like JRF said, it should look like;&lt;BR /&gt;&lt;BR /&gt;# ls -l  /usr/bin/which&lt;BR /&gt;-r-xr-xr-x   1 bin        bin            654 Nov 14  2000 /usr/bin/which&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 11:05:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694472#M612497</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-10-04T11:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694473#M612498</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;And besides, you can check these also:&lt;BR /&gt;# file  /usr/bin/which &lt;BR /&gt;/usr/bin/which: commands text&lt;BR /&gt;# what /usr/bin/which&lt;BR /&gt;/usr/bin/which:&lt;BR /&gt;        B.11.11_LR      &lt;BR /&gt;# echo $0&lt;BR /&gt;/sbin/sh&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 11:07:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694473#M612498</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-10-04T11:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694474#M612499</link>
      <description>&amp;gt;My which command is failing recently because of this error:&lt;BR /&gt;&lt;BR /&gt;Any reason you are using the scummy C shell or one if its utilities?&lt;BR /&gt;The real shell has "whence".</description>
      <pubDate>Mon, 04 Oct 2010 11:12:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694474#M612499</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-04T11:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694475#M612500</link>
      <description>&amp;gt; Any reason you are using the scummy C shell or one if its utilities?&lt;BR /&gt;&lt;BR /&gt;Check your's, Dennis.  I think you'll find that that is the way HP provided it to us: with the scummy C shell!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 04 Oct 2010 11:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694475#M612500</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2010-10-04T11:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694476#M612501</link>
      <description>&amp;gt;Pete: I think you'll find that that is the way HP provided it to us: with the scummy C shell!&lt;BR /&gt;&lt;BR /&gt;And that's why you don't use which(1).</description>
      <pubDate>Mon, 04 Oct 2010 11:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694476#M612501</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-04T11:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694477#M612502</link>
      <description>Hi everyone,&lt;BR /&gt;&lt;BR /&gt;i do have execute permission for which&lt;BR /&gt;&lt;BR /&gt; &amp;gt;ls -l /usr/bin/which&lt;BR /&gt;-r-xr-xr-x   1 bin        bin            664 Oct  4 18:04 /usr/bin/which&lt;BR /&gt;&lt;BR /&gt;&amp;gt;csh /usr/bin/ls&lt;BR /&gt;sh: csh: Execute permission denied.&lt;BR /&gt;&lt;BR /&gt;by the way, is the "whence" and "which" command just the same? in my 5 years of IT work experience I never knew that there was a "whence" command.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 23:55:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694477#M612502</guid>
      <dc:creator>sysad1_1</dc:creator>
      <dc:date>2010-10-04T23:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694478#M612503</link>
      <description>whence (and it's VERY useful alias type which is the even more useful whence -v) replaces which and whereis. Neither which nor whereis will tell you exactly what happens when you enter a string on the command line. which knows nothing about "for" but...&lt;BR /&gt; &lt;BR /&gt;# which for&lt;BR /&gt;no for in /usr/sbin /usr/bin /opt/ansic/bin /usr/ccs/bin /usr/contrib/bin /opt/hparray/bin /opt/nettladm/bin /opt/upgrade/bin /opt/fcms/bin /opt/resmon/bin /opt/pd/bin /opt/gnome/bin /opt/perf/bin /opt/ignite/bin /usr/contrib...etc&lt;BR /&gt; &lt;BR /&gt;# whereis for&lt;BR /&gt;for:&lt;BR /&gt; &lt;BR /&gt;# whence -v for&lt;BR /&gt;for is a keyword.&lt;BR /&gt; &lt;BR /&gt;which is useless for aliases and shell builtins. Other examples:&lt;BR /&gt; &lt;BR /&gt;# type type&lt;BR /&gt;type is an exported alias for whence -v&lt;BR /&gt;# type ulimit&lt;BR /&gt;ulimit is a shell builtin.&lt;BR /&gt;# type pwd&lt;BR /&gt;pwd is a shell builtin.&lt;BR /&gt;# alias pwd=/usr/bin/pwd&lt;BR /&gt;# type pwd&lt;BR /&gt;pwd is an alias for /usr/bin/pwd&lt;BR /&gt; &lt;BR /&gt;type (whence) tells you what will happen if you type a string of characters. It finds shell aliases, keywords, basically anything that the shell does for you. This is much more useful than which and whereis.&lt;BR /&gt; &lt;BR /&gt;HP provides the scummy C shell but that doesn't mean you should use it. Fir sysadmins, only a real shell (with standards like POSIX) like ksh or the POSIX shell sh (or even bash) provide consistent and portable results.</description>
      <pubDate>Tue, 05 Oct 2010 00:46:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694478#M612503</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-10-05T00:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694479#M612504</link>
      <description>&amp;gt;I do have execute permission for which&lt;BR /&gt;-r-xr-xr-x 1 bin bin 664 Oct 4 18:04 /usr/bin/which&lt;BR /&gt;&lt;BR /&gt;Do you have it for the scummy C shell?&lt;BR /&gt;ll /usr/bin/csh&lt;BR /&gt;&lt;BR /&gt;While this is a rather clever trick to prevent users from using the scummy C shell, you should put the system back the way is was.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;is the "whence" and "which" command just the same? in my 5 years of IT work experience I never knew that there was a "whence" command.&lt;BR /&gt;&lt;BR /&gt;Not really, though similar:&lt;BR /&gt;$ which csh&lt;BR /&gt;/usr/bin/csh    # scummy C shell&lt;BR /&gt;$ whence -pv csh&lt;BR /&gt;csh is /usr/bin/csh&lt;BR /&gt;$ whence -v csh&lt;BR /&gt;csh is a tracked alias for /usr/bin/csh&lt;BR /&gt;&lt;BR /&gt;If you know what makes the C shell scummy, you would know that which(1) is scummy too.&lt;BR /&gt;&lt;BR /&gt;And real shell users, use whence.  Since it is built into a real shell, it can tell you more things.</description>
      <pubDate>Tue, 05 Oct 2010 03:50:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694479#M612504</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-05T03:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694480#M612505</link>
      <description>&amp;gt;prompt@localhost&amp;gt;which&lt;BR /&gt;which[7]: Syntax error at line 7 : `(' is not expected.&lt;BR /&gt;&lt;BR /&gt;One other way to get this error is to link scummy csh to a real shell.&lt;BR /&gt;I get a different error if csh isn't executable.</description>
      <pubDate>Tue, 05 Oct 2010 04:01:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694480#M612505</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-05T04:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: which command error, need help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694481#M612506</link>
      <description>thanks for all the replies. I already made use of whence instead of which.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Oct 2010 02:22:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/which-command-error-need-help/m-p/4694481#M612506</guid>
      <dc:creator>sysad1_1</dc:creator>
      <dc:date>2010-10-06T02:22:52Z</dc:date>
    </item>
  </channel>
</rss>

