DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T e

⟦07c4a0771⟧ TextFile

    Length: 792 (0x318)
    Types: TextFile
    Names: »editentry«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/quipu/dish/editentry« 

TextFile

#!/bin/sh
#
if [ $# != "1" ]; then
	echo usage: $0 filename
	exit 1
fi

while test -z "$EDITOR"
do
	echo 'You do not have the shell variable $EDITOR set.'
	echo "For your convenience when using $0(1), you might prefer to set it"
	echo 
	echo -n "Enter the name of an editor: "
	read EDITOR rubbish
done


while true
do
	# now edit the file
	cp $1 $1.tmp
	$EDITOR $1
	if [ $? != "0" ]; then
		rm -f $1.tmp
		exit 1
	fi

	mess="Are you sure you want to make these changes ? "
	if ( cmp -s $1 $1.tmp )
	then
		mess="No changes to draft entry - shall I continue ? "
	fi
	
	echo -n $mess
		while read YN rubbish
		do
			case $YN in
			    y|yes|Y|YES) 
			    		rm -f $1.tmp
			    		exit 0;;
			    n|no|N|NO) 	
					mv $1.tmp $1
			    		exit 1;;
			    *)		echo -n $mess;;
			esac
		done
done