X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; q=dns; s=default; b=Fl IxEr11NoMOUtj1NHz/uXkGaaUDA+HBWnJ0HdwQfhUANO4KxA+cbU/XeVj0ctmttV IK22VlF9N0EXMGxI+kiSMjo9GCywCsd/HLARSp8l2S101/R4lAGBZ88BgjF8Qgj5 ju76XhXKBfksH1qt2Ha+iaSTlI5lOBGL6+VDxBqvw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; s=default; bh=QcivcAMC efU/O1gl1waz4FhZua0=; b=TEHg8hDYGnxmyRnvDSFUlSF71TPLvWZ1WILLnOL3 ccx23n107TSQ3vfw2HfRfAyjN5DjOzZVZ7wLN5zChyT61tjBrUaSXSJ0PI6DMnuO WgTbWHurplSJZzsqtB7Y5oGQjFOcfyr1ORuVphISxUzIFW7+VCMnQ6/cAfXrPVu3 3pU= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Kenneth, kenneth, H*i:sk:aBJ7Agb, H*f:sk:aBJ7Agb X-HELO: mail-lf0-f49.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=BF0F2ppr0UGE8H3qoq+UDfZGwTiPfqZftU+kc+5eQ4E=; b=TwFLIlqvMihpo3X0PiF1SfpKs9rjuqs/B0YymBMECgU7yEmhCyedWmL79qAGnwKnKR zqlzDeLyL6nT3r13MMHR725WXBQUMb7FIKP7+tcKtx2GHnHde5du0FftoU9IQdSzoqTD FlhcD1UGn0YL+bK3ev7BBnk154AjKol/0GnJinz+EeXkC03+cK5aVzI9X3+mY9D/icFa M3fXl4qGX2Fy+HZxVBUkxke6tSlGnVibc48bF+M1FihO8LKvk8UFpAuyJvhhQ9ZAjPmr plIXb4Jdb+oeIFBvX88ZNx0LI1HRw2iugTP711ouGoQWrXYYBHvYrIJuEX4ohbezbOFr wpKA== X-Gm-Message-State: AG10YOTpZPAdx2cR/N4ClsGQg2kU2JUwLcHLTaROeaw0bD7KE8mWN32yve+J/ZmMl9JeJjVhbQede+4Cn3MOVA== MIME-Version: 1.0 X-Received: by 10.25.64.9 with SMTP id n9mr2240901lfa.13.1453505669836; Fri, 22 Jan 2016 15:34:29 -0800 (PST) In-Reply-To: References: Date: Fri, 22 Jan 2016 18:34:29 -0500 Message-ID: Subject: Re: Using Perl on Cygwin; how to prevent display of unwanted usage/error message? From: Erik Soderquist To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes In cygwin, I use >/dev/null 2>&1 quite frequently and it works as expected. In windows cmd.exe, I don't know why they would recommend the < part for dealing with output, but I have used >NUL 2>&1 for the same effect in Windows command shells. -- Erik On Fri, Jan 22, 2016 at 6:21 PM, Kenneth Wolcott wrote: > Hi; > > I'm using a qx call to "net user username /DOMAIN" (probably should > use system instead) to determine whether a person having an active > account in an application is still an employee. > > I get two messages back (error and/or usage) when a username is not found. > > "The user name could not be found." > > and > > "More help is available by typing NET HELPMSG 2221." > > I'd like to hide (not display, not print) these two messages. > > Coming from a UNIX/Linux background, I'd do a "2>&1 > /dev/null" > operation to dispose of STDOUT and STDERR, but "1<&2 > NUL" (suggested > by > > "https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true" > > does not seem to work. > > I tried file descriptor 3, but that resulted in an error regarding > unsupported file handle,. or something like that. > > I was considering using IPC::Run3, but I don't think that will help > with suppressing error message and usage message. > > Perhaps there is a Perl module that is native to Cygwin that will > perform this kind of lookup for me? Maybe a Perl module that is NOT > native to Cygwin? > > Thanks, > Ken Wolcott > > -- > Problem reports: http://cygwin.com/problems.html > FAQ: http://cygwin.com/faq/ > Documentation: http://cygwin.com/docs.html > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple