Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Axel Dreher Subject: Issues with read and loop in bash Date: Mon, 25 Oct 2004 09:47:39 +0000 (UTC) Lines: 65 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 217.110.222.146 (Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8a3) Gecko/20040817) X-IsSubscribed: yes Hello @all, I`m new to this group, so please apologize if my posting does not conform to formal restrictions. ;-) In addition, my english is quite poor, so please apologize this too. ;-) Well, I have following problem. I searched this already in the gmane-database for this newsgroup, but didn`t find an appropriate answer. (possible bad searchwords?) I wrote a shell script using bash at Suse 9.1. This shell script includes following section: ----------------snip------------------------------- while read lines do check=FALSE while read lines_2 do if ([ $lines = $lines_2 ]) then # this is line 63 check=TRUE break fi done < $3/only_hashes_right.log if ([ $check = FALSE ]) then echo $lines >> $3/singles_only_hashes.log fi done < $3/only_hashes_left.log -----------------------snip------------------------------------ The logfiles just have hashes (of pdf-files) inside, created by md5sum. Each of the 2 logfiles have some thousand of these hashes, one per line. In the outer loop each hash is read from the first logfile and will be compared with each hash in the second logfile using the inner loop. If a "Partner" is found, the inner loop breaks. If no Partner is found, this hash is printed in a third logfile called singles_only_hashes.log, as you can see above. I`m not sure if the check-variable is necessary, though. With Suse this section and the whole script works properly, but not with bash under cygwin with Windows XP. It creates following error message: line 63: [: too many arguments and this a thousand of times. I marked the corresponding line in the script above. I also used as "shebang" this: #!/bin/bash instead of #!/bin/sh, but this didn`t solve the problem. Could anybody point me to the right direction? Any help is greatly appreciated. Best regards, Axel Dreher -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/