HELP! (What's wrong with this sh script?)

phaedrus at eneevax.UUCP phaedrus at eneevax.UUCP
Mon Apr 23 02:52:03 AEST 1984


What I want it do is to take the arguements (filenames) and just show
the first 20 lines of the file and then ask "Would you like me to remove
(filename)?", if yes then remove it, if no don't.

The error message I keep getting is, "unexpected newline on line 10".
This is the line with the "if" statement.


#! /bin/sh
for i 
do
	set $ANSWER=no
	head -20 $i
	echo -n 'Would you like me to remove '
	echo -n "$i"
	echo ' ?'
	set $ANSWER=$<
	if [ $ANSWER = yes -o $ANSWER = y ] 
	then
		rm $i
	fi

done

				Thanks in advance,
				Pravin Kumar

-- 


>From the brainless and rotted body of the sophist.

ARPA:   phaedrus%eneevax%umcp-cs at CSNet-Relay
BITNET: phaedrus at UMDC
UUCP:   {seismo,allegra,brl-bmd}!umcp-cs!eneevax!phaedrus



More information about the Comp.unix mailing list