c8df6e76e9b2aa022389917034da926909fa3608
[techtalk-pse.git] / examples / simple / functions
1 # -*- shell-script -*-
2
3 # Place any local environment variables required in 'local'.
4 if [ -f local ]; then source local; fi
5
6 export PS1="$ "
7
8 export HISTFILE=$talkdir/history
9
10 rm -f $HISTFILE
11 touch $HISTFILE
12
13 add_history ()
14 {
15     echo "$@" >> $HISTFILE
16 }
17
18 terminal ()
19 {
20     # Make $HISTFILE unwritable so the shell won't update it
21     # when it exits.
22     chmod -w $HISTFILE
23
24     # Run gnome-terminal.
25     exec \
26         gnome-terminal \
27         --window \
28         --geometry=+100+100 \
29         --hide-menubar \
30         --disable-factory \
31         -e '/bin/bash --norc' \
32         "$@"
33 }