<?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: whence in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018980#M763746</link>
    <description>Hy&lt;BR /&gt;&lt;BR /&gt;It checks whether the file in $2 exsits or not&lt;BR /&gt;&lt;BR /&gt;Regards</description>
    <pubDate>Fri, 15 Dec 2006 06:08:07 GMT</pubDate>
    <dc:creator>Oviwan</dc:creator>
    <dc:date>2006-12-15T06:08:07Z</dc:date>
    <item>
      <title>whence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018978#M763744</link>
      <description>Hello.&lt;BR /&gt;&lt;BR /&gt;Could you please let me know what will below command do:&lt;BR /&gt;&lt;BR /&gt;if [ -f ${2} -o "$(whence $2)" != "" ];&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Fri, 15 Dec 2006 05:57:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018978#M763744</guid>
      <dc:creator>panchpan</dc:creator>
      <dc:date>2006-12-15T05:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: whence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018979#M763745</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The statement tests whether or not the second argument ($2) passed to the script or to a script function, represents a file ('-f'), *or* if the name of the argument represents a command.&lt;BR /&gt;&lt;BR /&gt;# whence date&lt;BR /&gt;/usr/bin/date&lt;BR /&gt;&lt;BR /&gt;# [ -f date ] &amp;amp;&amp;amp; echo ok || echo not_ok  &lt;BR /&gt;not_ok&lt;BR /&gt;&lt;BR /&gt;# [ -f /usr/bin/date ] &amp;amp;&amp;amp; echo ok       &lt;BR /&gt;ok&lt;BR /&gt;&lt;BR /&gt;The above shows that an argument of 'date' does not represent a file, but 'whence date' returns '/usr/bin/date' and thus the expression (statement) would evaluate to true.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 15 Dec 2006 06:07:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018979#M763745</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-15T06:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: whence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018980#M763746</link>
      <description>Hy&lt;BR /&gt;&lt;BR /&gt;It checks whether the file in $2 exsits or not&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 15 Dec 2006 06:08:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018980#M763746</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2006-12-15T06:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: whence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018981#M763747</link>
      <description>Hi,&lt;BR /&gt;if second parameter is a local file or a command then the condition would return true.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# My name is a.sh&lt;BR /&gt;if [ -f ${1} -o "$(whence $1)" != "" ] &lt;BR /&gt;then &lt;BR /&gt;echo "valid file or command"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;First test:&lt;BR /&gt;$ ./a.sh date&lt;BR /&gt;valid file or command&lt;BR /&gt;&lt;BR /&gt;Second test:&lt;BR /&gt;$ ./a.sh fred&lt;BR /&gt;$ &lt;BR /&gt;&lt;BR /&gt;Third test:&lt;BR /&gt;$ touch fred&lt;BR /&gt;$ ./a.sh fred&lt;BR /&gt;valid file or command&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Dec 2006 06:16:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018981#M763747</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-12-15T06:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: whence</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018982#M763748</link>
      <description>THANK YOU</description>
      <pubDate>Fri, 15 Dec 2006 06:36:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/whence/m-p/5018982#M763748</guid>
      <dc:creator>panchpan</dc:creator>
      <dc:date>2006-12-15T06:36:47Z</dc:date>
    </item>
  </channel>
</rss>

