Which.csh



#  which.csh, Release 2.3.g
#  Copyright (c) 1998-2000 by Hamilton Laboratories.  All rights reserved.

proc which (cmd)

   #  Figure out what will be run if cmd is typed.
   #  The search order is:
   #     1. Aliases
   #     2. Procedures
   #     3. Executable files

   local save_nonovar
   @ save_nonovar = nonovar
   @ nonovar = 2
   if (cmd !~ "*.*") then
      if (`eval alias $cmd | wc -l`) then
         echo -n 'alias '
         eval alias $cmd
      else
         if (`eval proc $cmd | wc -l`) then
            echo -n 'proc  '
            eval proc $cmd
         else
            whereis $cmd |& head -1
         end
      end
   else
      whereis $cmd |& head -1
   end
   @ nonovar = save_nonovar
end

which $argv



Hamilton C shell | Free Updates | Free Demo Software | Win32 Training
Y2K | Customer Testimonials | On-line Hamilton C shell User Guide
Home | Email | Support | Company Profile | Distributors | Links



Copyright © 1997-2001 by Hamilton Laboratories. All rights reserved.
You are visitor number 480. This page was last modified August 14, 2001.