Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A slightly better script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A slightly better script
Authored by: netdpb on Apr 15, '03 12:43:16PM
Try the following. It allows you to choose to revert your changes before returning to Pine.
#!/bin/bash

tmpfile=$(mktemp -t $(basename $0))

touch $1
cp $1 $tmpfile
open -a "Path To Your Favorite Editor.app" $1
read -e -p "Enter to continue, N to revert: "
if [[ "$REPLY" == [nN]* ]]; then
  cat $tmpfile >$1
fi


[ Reply to This | # ]