Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site eneevax.UUCP Path: utzoo!watmath!clyde!akgua!mcnc!decvax!harpo!seismo!rlgvax!cvl!umcp-cs!eneevax!phaedrus From: phaedrus@eneevax.UUCP Newsgroups: net.unix Subject: HELP! (What's wrong with this sh script?) Message-ID: <112@eneevax.UUCP> Date: Sun, 22-Apr-84 11:52:03 EST Article-I.D.: eneevax.112 Posted: Sun Apr 22 11:52:03 1984 Date-Received: Mon, 23-Apr-84 07:11:37 EST Organization: The EE Dept. Maryversity of Uniland Lines: 35 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@CSNet-Relay BITNET: phaedrus@UMDC UUCP: {seismo,allegra,brl-bmd}!umcp-cs!eneevax!phaedrus