From 01e6b21ad07220ce7cdc5bc850e9d5b55d11b953 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 10 Feb 2018 20:36:32 +0100 Subject: [PATCH] support ancient bash TLNote: osx --- README.md | 2 +- clients/bash.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f3d050..88ef3f3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/clients/bash.sh b/clients/bash.sh index d54a5d7..e26d6b8 100755 --- a/clients/bash.sh +++ b/clients/bash.sh @@ -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" |