delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/01/22/18:21:23

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:date:message-id:subject:from:to
:content-type; q=dns; s=default; b=eD7jHVnRRhjCtCaZqj4zkNwQs8Tdt
jK0zPqbGArE73DjI/SiepeEE82oD3g+9IiMSBa+WbfRRmYCPXGJLVyQrHs1baclu
iYZTDOtoa5dHa6fIQqtre1OSHJ5PHQv4SfkTrlBuAM4Lvt7EcYqYYwWqxmKBGrxe
1vjnPRRh4VNae4=
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:date:message-id:subject:from:to
:content-type; s=default; bh=ypJBRwZ0MBx40sn5+SPOieT6m7E=; b=a56
o9DJIAVFZzJ8WklC/DxUpp2QHrqfiO6hPVbn6XscffAgPjQ6eiXKV8hUAC4wIXjO
xwbeuG/irtyxlIMBJvAQy251j2cNTd+epI3qi+JR47pL7xKc+X3XvEidJXD7ea3l
NAqCiQUml8DZBXTSUk5lZXkJ/gu+RTX0PnTFdFoM=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=employee, IPC, hide, sk:www.mic
X-HELO: mail-yk0-f179.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:date:message-id:subject:from:to :content-type; bh=OwBJJQl1tf3aatUwxzrcJErNtgFFordSNTk9QR7nTW8=; b=B+JNheB1FZg/nxpCFleKgUGnrqkjXaISrdSy3f76a6ggvxMuthiRt8mxVvLB20o1cQ NTnCku+t6/mC5kJIytu7ps67slDXOzDQ464MPtGuq8TLIzczPJ9ebyKzW5Sj/+X9BVpt cjQ2XcmamqxP1tS+yzMbfb2tQJyRzXEjsgk7wVkVmlXxunnpvgER7DbQvfF6g1B8lGno at/RTpM65urCEOrzjDnW2bn6+wgRvuqoggXif2JnvW3izyIpFKx2S6MscUTkirKAR+Yn ThDjVDyMHOJi12kFKXgwbSMSdDHB0Zn2w+n4RY1Uk1I3CngQRGNXUXjJA0d9m9kyAls4 zM7w==
X-Gm-Message-State: AG10YOQj0KlzAW79urw2JGbB3PfjZSYlX6//Z2S9gDyK81HSSD374ZsKdW2O0IkpvInAai5sbDbzBsi2EBhc/Q==
MIME-Version: 1.0
X-Received: by 10.129.70.10 with SMTP id t10mr3256339ywa.284.1453504862182; Fri, 22 Jan 2016 15:21:02 -0800 (PST)
Date: Fri, 22 Jan 2016 15:21:02 -0800
Message-ID: <CADex0xzfB3=aBJ7AgbTJ0hQKpmD0JSnX6xcjmu4fmqy284j5jw@mail.gmail.com>
Subject: Using Perl on Cygwin; how to prevent display of unwanted usage/error message?
From: Kenneth Wolcott <kennethwolcott AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

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

- Raw text -


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