Regarding the historical thread about sharing your bash history as a dropbox file with students, I updated the aliases so it changes the prompt to remind you that you are recording to a public file (!) You might want to make the PS1 command a bit more subtle (just add a ## or something)…
(The extra DAZ variable is because I couldn’t figure how to get the quotes around the date formatting string inside all the other quotes…) -Steve alias start_recording='DAZ=$(date "+%m-%d %H:%M:%S"); echo "#HISTORY started $DAZ" >> ~/Dropbox/Public/history.txt; export PROMPT_COMMAND="history 1 | cut -c 8- >> ~/Dropbox/pcfbfhl/history.txt"; PS1="#REC#:\W \u\$ "' alias stop_recording='export PROMPT_COMMAND=""; PS1="\h:\W \u\$ "; DAZ=$(date "+%m-%d %H:%M:%S"); echo "#HISTORY stopped $DAZ" >> ~/Dropbox/Public/history.txt' alias clearhist='export PROMPT_COMMAND=""; rm -f ~/Dropbox/pcfbfhl/history.txt; PS1="\h:\W \u\$ "; DAZ=$(date "+%m-%d %H:%M:%S"); echo "#HISTORY cleared $DAZ" > ~/Dropbox/Public/history.txt' _______________________________________________ Discuss mailing list [email protected] http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org
