support ancient bash

TLNote: osx
This commit is contained in:
ed 2018-02-10 20:36:32 +01:00
parent d861d7bf0c
commit 01e6b21ad0
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,7 @@ most to least recommended
| bash | [mostly internals](clients/bash.sh) |
| netcat | `nc r0c.int 531` |
you can even `exec 147<>/dev/tcp/r0c.int/531;cat<&147 &while IFS= read -rN1 x;do printf '%s' "$x">&147;done` (disconnect using `exec 147<&-; killall cat #sorry`)
you can even `exec 147<>/dev/tcp/r0c.int/531;cat<&147 &while IFS= read -rn1 x;do [[ "x$x" == "x" ]] && x=$'\n'; printf '%s' "$x">&147;done` (disconnect using `exec 147<&-; killall cat #sorry`)
## firewall rules

View File

@ -31,8 +31,11 @@ function connect()
cat <&147 & cat_pid=$!
# read keyboard and send each key to the socket
while IFS= read -rN1 x
while IFS= read -rn1 x
do
[[ "x$x" == "x" ]] &&
x=$'\n'
[[ $debug ]] &&
{
printf '%s' "$x" |