/usr/bin/expect_rlogin-cwd is in expect-dev 5.45-5ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \
exec tclsh8.6 "$0" ${1+"$@"}
package require Expect
# rlogin-cwd - rlogin but with same directory
#
# You can extend this idea to save any arbitrary information across rlogin
# Don Libes - Oct 17, 1991.
set prompt "(%|#|\\$) $" ;# default prompt
catch {set prompt $env(EXPECT_PROMPT)}
eval spawn rlogin $argv
set timeout 60
expect eof exit timeout {send_user "timed out\n"; exit} -re $prompt
send "cd [pwd]\r"
interact
|