delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/09/14/11:09:24

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 14 Sep 2007 11:08:51 -0400
From: Jean-Claude Gervais <jc DOT gervais AT videotron DOT ca>
Subject: Whither /dev/null ?
To: Cygwin <cygwin AT cygwin DOT com>
Message-id: <1189782531.24064.8.camel@mercury.sprymusic>
MIME-version: 1.0
X-Mailer: Evolution 2.10.2
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

Hello,

I am writing bash scripts that are required to run unchanged (as much as
possible) on Cygwin and Linux.

A (small) detail I am having problems with is the issue of redirecting
output to the null device, or bit-bucket.

If I write the following

ls > nul

It works as expected under Cygwin, however under Linux I must write

ls > /dev/null

I searched and found discussions on the Cygwin mailing list that seemed
to say that Cygwin supported (supports?) the /dev/null device, but I
checked my installation and this pseudo-device didn't seem to exist on
my system. The '/dev' folder was missing.

I discovered that if I created the folder '/dev', afterwards
the /dev/null device existed, even if it does not appear as an actual
file under /dev

I installed cygwin only a few weeks ago using the
http://www.cygwin.com/setup.exe method, and it was missing the /dev
folder.

I compared this to the other machines around me which are running a
version of Cygwin which is about two years old, same results: /dev is
missing, but creating it unleashes the /dev/null pseudo-device.

I'm wondering what is the best way to deal with this? I'd like the
scripts to work straight out of the box and not have to make the users
create their own /dev and creating it for them would be tedious because
every script would have to check for this...

Any advice?
Puzzled about nothing.
J


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