delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/28/13:07:43

X-Spam-Check-By: sourceware.org
Mime-Version: 1.0 (Apple Message framework v746.2)
In-Reply-To: <d4c0d4800601271055tab581c5haf13ae26d1d3a7d3@mail.gmail.com>
References: <d4c0d4800601271055tab581c5haf13ae26d1d3a7d3 AT mail DOT gmail DOT com>
Message-Id: <DD53CF32-E4C5-48B6-B2F7-E10D65D51438@rehley.net>
From: Peter Rehley <peter AT rehley DOT net>
Subject: Re: csh script hangs only on cygwin
Date: Sat, 28 Jan 2006 10:07:32 -0800
To: "Cygwin List'" <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Jan 27, 2006, at 10:55 AM, Stewart Midwinter wrote:

> I've been able to isolate a problem with csh on cygwin running on
> Windows Server 2003 on a Xeon.  The following script hangs after a
> certain period of time ranging from a few minutes to a few hours.
>
> ---------------
> #!/bin/csh
>
> while (1)
>         set year = `date +%y`
>         set month = `date +%m`
>         set day = `date +%d`
>         set hour = `date +%H`
>         set minute = `date +%M`
>         set second = `date +%S`
>         set stamp = "$year$month$day $hour : $minute : $second"
>         echo $stamp
>         sleep 2
> end
> ------------
>
> The equivalent script in bash doesn't hang even after a day or more.
>
> -------------
> #!/bin/bash
>
> while [ 1 ]; do
>         echo $(date +%Y%m%d.%H%M%S)
>         sleep 2
> done
> -------------

This isn't the equivalent script.  It's similar and the output is the  
same, but you only call date once here, while in the other you call  
it 6 times.  Maybe that is way it seems to work for bash and not csh.

>
> Has anyone else had problems with csh scripts on cygwin? Yes, I know
> that some people don't recommend using csh (see "Csh programming
> considered harmful",
> http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/), but I'm stuck
> with a whole lot of csh scripts and don't have time to port them all
> at the moment.
I have problems with bash/sh script hanging, but I haven't tried csh.

http://cygwin.com/ml/cygwin/2006-01/msg00549.html

Which I'm getting in 1.5.19-4 too, but I haven't tried the latest  
snapshot.  Which reminds me.  Could  you read http://cygwin.com/ 
problems.html and provide the information that it says to provide?

Also were in the script does it hang.  It you type ps -ef what do you  
see.  What information does the /proc directory tell you.  Can you  
ctrl-c out of the script?

Basically, provide as much information as possible.

Peter


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019