Skip to content

Instantly share code, notes, and snippets.

@joshix
Created June 21, 2020 23:12
Show Gist options
  • Select an option

  • Save joshix/e0ace3cdfe7b7abeabf0d6983744645e to your computer and use it in GitHub Desktop.

Select an option

Save joshix/e0ace3cdfe7b7abeabf0d6983744645e to your computer and use it in GitHub Desktop.
#!/bin/rc
clonefile=/net/tcp/clone
if(! ~ $#* 2) {
echo Usage: telnet ip port >[1=2]
exit usage
}
<[4] $clonefile {
netdir=`{basename -d $clonefile} ^ / ^ `{cat /fd/4}
echo connect $1!$2 >$netdir/ctl || exit 'cannot connect'
cat $netdir/data &
cat >$netdir/data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment