mc-wrapper.csh.in 466 B

1234567891011121314151617181920
  1. if ($?MC_TMPDIR) then
  2. setenv MC_PWD_FILE "`mktemp '$MC_TMPDIR/mc.pwd.XXXXXX'`"
  3. else if ($?TMPDIR) then
  4. setenv MC_PWD_FILE "`mktemp '$TMPDIR/mc.pwd.XXXXXX'`"
  5. else
  6. setenv MC_PWD_FILE "`mktemp '/tmp/mc.pwd.XXXXXX'`"
  7. endif
  8. @bindir@/mc -P "$MC_PWD_FILE" $*
  9. if (-r "$MC_PWD_FILE") then
  10. setenv MC_PWD "`cat '$MC_PWD_FILE'`"
  11. if ("$MC_PWD" != "$cwd" && -d "$MC_PWD") then
  12. cd "$MC_PWD" || true
  13. endif
  14. unsetenv MC_PWD
  15. endif
  16. rm -f "$MC_PWD_FILE"
  17. unsetenv MC_PWD_FILE