mc-wrapper.sh.in 476 B

1234567891011121314151617181920
  1. if test -n "$MC_TMPDIR"; then
  2. MC_PWD_FILE="`mktemp "${MC_TMPDIR}/mc.pwd.XXXXXX"`"
  3. elif test -n "$TMPDIR"; then
  4. MC_PWD_FILE="`mktemp "${TMPDIR}/mc.pwd.XXXXXX"`"
  5. else
  6. MC_PWD_FILE="`mktemp "/tmp/mc.pwd.XXXXXX"`"
  7. fi
  8. @bindir@/mc -P "$MC_PWD_FILE" "$@"
  9. if test -r "$MC_PWD_FILE"; then
  10. MC_PWD="`cat "$MC_PWD_FILE"`"
  11. if test -n "$MC_PWD" && test "$MC_PWD" != "$PWD" && test -d "$MC_PWD"; then
  12. cd "$MC_PWD" || true
  13. fi
  14. unset MC_PWD
  15. fi
  16. rm -f "$MC_PWD_FILE"
  17. unset MC_PWD_FILE