logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

which.sh (471B)


  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. plans=3
  5. WD="$(dirname "$0")"
  6. target="${WD}/../cmd/which"
  7. . "${WD}/tap.sh"
  8. CMD_DIR="$(realpath "${WD}/../cmd/")"
  9. t_cmd normal "${CMD_DIR}/which
  10. " env PATH="/var/empty:${CMD_DIR}" "$target" which
  11. t_cmd enoent "${CMD_DIR}/which
  12. " env PATH="/var/empty:/var/empty/enoent:${CMD_DIR}" "$target" which
  13. t_args slash "games/doom
  14. " "games/doom"