X-Git-Url: http://git.annexia.org/?p=techtalk-pse.git;a=blobdiff_plain;f=examples%2Fsimple%2Ffunctions;h=daacc22f660edad43dacf630ee03b7348eb11209;hp=03d70cf53f0f93312bafd1708d9c3991c24bce4d;hb=bb786259cdeab9332a705f8a55ed79f6ac8532cc;hpb=b54f2074ed5db2af967f971716443a62de3d991d diff --git a/examples/simple/functions b/examples/simple/functions index 03d70cf..daacc22 100644 --- a/examples/simple/functions +++ b/examples/simple/functions @@ -1,9 +1,14 @@ # -*- shell-script -*- +# Place any local environment variables required in 'local'. +if [ -f local ]; then source local; fi + export PS1="$ " -export HISTFILE=/tmp/history + +export HISTFILE=$talkdir/history rm -f $HISTFILE +touch $HISTFILE add_history () { @@ -12,11 +17,10 @@ add_history () terminal () { - exec \ - gnome-terminal \ - --window \ - --geometry=+100+100 \ - --hide-menubar \ - -e '/bin/bash --norc' \ - "$@" + # Make $HISTFILE unwritable so the shell won't update it + # when it exits. + chmod -w $HISTFILE + + # Execute a shell. + bash --norc "$@" }