#!/bin/bash if [ $# -eq 0 ] # Script invoked with no command-line args? then echo "Usage: `basename $0` options:" echo "--note -- note" echo "--search -- search" echo "--console -- show in console" echo "--edit -- edit in TextWrangler" echo "--show -- display" exit fi if [[ $1 = --note ]] ; then tmptimestamp="`date +\"%Y-%m-%d %H:%M:%S\"` $2" echo $tmptimestamp > /tmp/temp-log-line.txt prepend /tmp/temp-log-line.txt /Users/mharris/Archive/Backups/personal-notes.log rm /tmp/temp-log-line.txt echo -e "" echo "Logged." echo -e "" head -n 1 /Users/mharris/Archive/Backups/personal-notes.log echo -e "" exit fi if [[ $1 = --search ]] ; then grep --no-filename --ignore-case "$2" /Users/mharris/Archive/Backups/personal-notes.log exit fi if [[ $1 = --console ]] ; then open -a '/Applications/Utilities/Console.app/' /Users/mharris/Archive/Backups/personal-notes.log exit fi if [[ $1 = --edit ]] ; then edit /Users/mharris/Archive/Backups/personal-notes.log exit fi if [[ $1 = --show ]] ; then tail -r /Users/mharris/Archive/Backups/personal-notes.log exit fi
Also, Lynx is a text-based web browser.
posted by Doofus Magoo at 9:55 AM on December 1, 2009