nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #! /bin/bash
2 # source: readline.sh
3 # Copyright Gerhard Rieger 2003-2004
4 # Published under the GNU General Public License V.2, see file COPYING
5  
6 # this is an attempt for a socat based readline wrapper
7 # usage: readline.sh <command>
8  
9 withhistfile=1
10  
11 while true; do
12 case "X$1" in
13 X-nh|X-nohist*) withhistfile=; shift; continue ;;
14 *) break;;
15 esac
16 done
17  
18 PROGRAM="$@"
19 if [ "$withhistfile" ]; then
20 HISTFILE="$HOME/.$1_history"
21 HISTOPT=",history=$HISTFILE"
22 else
23 HISTOPT=
24 fi
25 mkdir -p /tmp/$USER || exit 1
26 #
27 #
28  
29 exec socat -d readline"$HISTOPT",noecho='[Pp]assword:' exec:"$PROGRAM",sigint,pty,setsid,ctty,raw,echo=0,stderr 2>/tmp/$USER/stderr2
30