--- /dev/null
+history
\ No newline at end of file
#!/bin/bash -
source functions
-add_history guestfish -a vm1.img
-add_history guestfish -a vm2.img -m /dev/sda1
-terminal --title="Guestfish demonstration"
+add_history echo History command number 2
+add_history echo '"History command number 1"'
+terminal --title="Press the UP ARROW to get history"
</p>
<p>
-Now look at these files to find out how we did it:
+We hope you noticed on the previous slide that you
+could hit the <b>Up arrow</b> to get pre-populated
+history.
+</p>
+
+<p>
+Now look at these files in the current directory
+to find out how we did it:
</p>
<ul>
<li> 10-hello.html
<li> 20-shell.sh
<li> 30-goodbye.html
+<li> functions — common shell functions
+<li> style.css — stylesheet
+<li> code.js — Javascript
</ul>
# -*- shell-script -*-
-# Need a short sleep to allow the previous shell to exit, possibly
-# writing to the history file, before we start the new shell. Could
-# write to a different history file each time which would avoid this.
-sleep 1
+# 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 ()
{
terminal ()
{
+ # Make $HISTFILE unwritable so the shell won't update it
+ # when it exits.
+ chmod -w $HISTFILE
+
+ # Run gnome-terminal.
exec \
gnome-terminal \
--window \