source: CMT/v1r18p20041201/mgr/cmt_which.sh @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 727 bytes
Line 
1#!/bin/sh
2
3if test ! "${CMT_WHICH}" = "" ; then
4  echo ${CMT_WHICH}
5  exit 0
6fi
7
8which cat 1>/dev/null 2>/dev/null
9yes="$?"
10which abcdefghijklmnopqrstuvwxyz 1>/dev/null 2>/dev/null
11no="$?"
12if test "${yes}" = 0 -a "${no}" = 0 ; then
13  type cat 1>/dev/null 2>/dev/null
14  yes="$?"
15  type abcdefghijklmnopqrstuvwxyz 1>/dev/null 2>/dev/null
16  no="$?"
17  if test "${yes}" = 0 -a "${no}" = 0 ; then
18    /usr/bin/type cat 1>/dev/null 2>/dev/null
19    yes="$?"
20    /usr/bin/type abcdefghijklmnopqrstuvwxyz 1>/dev/null 2>/dev/null
21    no="$?"
22    if test "${yes}" = 0 -a "${no}" = 0 ; then
23      exit 1
24    else
25      echo "/usr/bin/type"
26    fi
27  else
28    echo "type"
29  fi
30else
31  echo "which"
32fi
33
34exit 0
Note: See TracBrowser for help on using the repository browser.