| Server IP : 37.9.174.138 / Your IP : 216.73.216.117 Web Server : Apache System : Linux vps6.backend.sk 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 User : ftpuser ( 1001) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/socat/examples/ |
Upload File : |
#! /usr/bin/env bash
# source: readline.sh
# Copyright Gerhard Rieger and contributors (see file CHANGES)
# Published under the GNU General Public License V.2, see file COPYING
# this is an attempt for a socat based readline wrapper
# usage: readline.sh [options] <program>
withhistfile=1
STDERR=
while true; do
case "X$1" in
X-lf?*) STDERR="${1:3}" ;;
X-lf) shift; STDERR="$1" ;;
X-nh|X-nohist*) withhistfile= ;;
*) break;;
esac
shift
done
PROGRAM="$@"
if [ "$withhistfile" ]; then
HISTFILE="$HOME/.$1_history"
HISTOPT=",history=$HISTFILE"
else
HISTOPT=
fi
#
#
#if test -w .; then
if [ -z "$STDERR" ] && find . -maxdepth 0 -user $USER ! -perm /022 -print |grep ^ >/dev/null; then
# When cwd is owned by $USER and it is neither group nor world writable
STDERR=./socat-readline.${1##*/}.log
rm -f $STDERR
echo "$0: logs go to $STDERR" >&2
elif [ -z "$STDERR" ]; then
echo "$0: insecure working directory, no logs are written" >&2
STDERR=/dev/null
else
echo "$0: logs go to $STDERR" >&2
fi
exec socat -d READLINE"$HISTOPT",noecho='[Pp]assword:' EXEC:"$PROGRAM",sigint,pty,setsid,ctty,raw,echo=0,stderr 2>$STDERR