This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sh/rm bug -- rm doesn't remove a file when run from cmd


I'm on Windows 2000sp3.

I've seen this bug before, but it disappeared.  Now, it's back.  I
recently updated to cygwin 1.3.19.  Nothing else on my system has
changed in a really long time.  I rebooted, and that didn't fix it.

Here's bug2.sh:

ls -l $2
echo "removing $2..."
rm $2
ls -l $2

First, it only happens from a cmd prompt.  If I do it from a bash
(started with cygwin.bat), it does _not_ fail.

Using `sh', the rm fails and doesn't print anything, but using `bash'
it works:

    D:\acl62\src\cl\src>ls -l foo.out
    -rw-r--r--    1 layer    None            6 Jan 28 13:28 foo.out

    D:\acl62\src\cl\src>sh bug2.sh xxx foo.out
    -rw-r--r--    1 layer    None            6 Jan 28 13:28 foo.out
    removing foo.out...
    -rw-r--r--    1 layer    None            6 Jan 28 13:28 foo.out

Didn't remove it.  Hmmm.  Let's see what bash does:


    D:\acl62\src\cl\src>bash bug2.sh xxx foo.out
    -rw-r--r--    1 layer    None            6 Jan 28 13:28 foo.out
    removing foo.out...
    ls: foo.out: No such file or directory

Yep, worked.

    D:\acl62\src\cl\src>which sh
    /usr/bin/sh

    D:\acl62\src\cl\src>bash --version
    GNU bash, version 2.05b.0(8)-release (i686-pc-cygwin)
    Copyright (C) 2002 Free Software Foundation, Inc.

    D:\acl62\src\cl\src>

Again, it _only_ happens when run from a cmd prompt.

Can anyone reproduce this?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]