- From: Joris van der Hoeven <address@hidden>
- To: address@hidden
- Subject: Re: GNU bash interface
- Date: Sat, 21 Sep 2002 10:39:17 +0200 (MET DST)
>
While exploring TeXmacs some more and playing with the
>
mycas example, I noticed that the shell session in
>
TeXmacs doesn't really facilitate interactive use..
>
for instance, the current directory reverts to the
>
TeXmacs cd after each command.
>
>
So, I coded a simple TeXmacs interface for bash. The
>
interface itself is a bash script which uses bash's
>
eval feature to provide more complete shell access.
>
>
This method has limitations too, but it is sufficient
>
for providing a bit more robust shell.. and it works
>
right now :)
>
>
It might be possible to hook bash directly into
>
TeXmacs without modification by using a suitable init
>
script and a special PS1 prompt.
>
>
But for now, here is the script:
Thanks for this valuable contribution; I will try it when
back home and check whether I can include it in the next version.
Best wishes, Joris
>
#!/bin/bash
>
function nextinput
>
{
>
COUNTER=$[$COUNTER+1]
>
echo -ne "\002"; echo -n "channel:prompt"; echo -ne
>
"\005"
>
echo -n "bash($COUNTER)] "
>
}
>
>
echo -ne "\002"; cat << EOF
>
verbatim:
>
GNU bash $BASH_VERSION
>
EOF
>
>
nextinput
>
echo -ne "\005"
>
>
while true; do
>
read buffer
>
if [ "$buffer" = "exit" ]; then
>
echo -ne "\005"; exit
>
fi
>
>
echo -ne "\002"; echo -n "verbatim:"
>
eval $buffer
>
>
nextinput
>
echo -ne "\005"
>
done
>
>
>
>
__________________________________________________
>
Do You Yahoo!?
>
Yahoo! Finance - Get real-time stock quotes
>
http://finance.yahoo.com
>
- GNU bash interface, michael graffam, 09/20/2002
- Re: GNU bash interface, Joris van der Hoeven, 09/21/2002
Archive powered by MHonArc 2.6.19.