#!/bin/bash -f

# Copyright Dr Bob Camp, Cygnus Technical Consulting  3/8/1998

# Setup utility for which.

# Usage: ./which-setup > <filename>

# Then edit <filename> to make /etc/which.conf and or ~/.which.




# Write progress to device 2 so as to delimit error messages.

tidy ()
{
  local x y s=0
  for y in $* ; do
    if (( $s )); then
      echo "$x \\"
    fi
    s=1
    x=$y
  done
  echo "$x"
}

echo "Searching for bin directories." >&2
echo
x=`find / -name sbin -o -name bin -o -name games -type d`
echo "PATH_A=\"`tidy $x`\""

echo "Searching for info directories." >&2
echo
x=`find / -name info -type d`
echo "INFOPATH_A=\"`tidy $x`\""

echo "Searching for man directories." >&2
echo
x=`find / -name man -type d`
echo "MANPATH_A=\"`tidy $x`\""

echo "Searching for include directories." >&2
echo
x=`find / -name include -type d`
echo "INCPATH_A=\"`tidy $x`\""

echo "Searching for lib directories." >&2
echo
x=`find / -name lib -type d`
echo "LIBPATH_A=\"`tidy $x`\""

echo "Searching for src directories." >&2
echo
x=`find / -name src -type d`
echo "SRCPATH_A=\"`tidy $x`\""

echo "Searching doc directories." >&2
echo
x=`find / -name doc -type d`
echo "DOCPATH_A=\"`tidy $x`\""

# End

