From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28167 invoked by alias); 22 Aug 2017 15:19:00 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 27643 invoked by uid 89); 22 Aug 2017 15:18:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=1604, 16.04, moss, Moss X-HELO: mail-qt0-f181.google.com Received: from mail-qt0-f181.google.com (HELO mail-qt0-f181.google.com) (209.85.216.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Aug 2017 15:18:58 +0000 Received: by mail-qt0-f181.google.com with SMTP id 16so98101708qtz.4 for ; Tue, 22 Aug 2017 08:18:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Cy7qwtGEDhSASQ6GeGUkuZpsDKyKBfokiy80ncEoky0=; b=ACuW17ts/wPb+IP27hD1mnFHy8TPUv4QqvNrJElEBdzQ8ZwhAELKH/51jYn/TBTVb1 h/q5ErYl4C51RqFh3MR2hcA8XGAA9DybwEr13rQx/cEaiuM5yR+OoZjlsUT9fYBNHd4E KpgBGRDtDtISDgASfzHnxUhN1RuLL7nEgKOXUv9+bUZUAzl5E/zOlmhZ6nZ6HtEMkkG1 PlBJ+r+xEtbBpwecvKLuWjp1j9xF4o1pmsC4t0Ragc6i6jTHgzt06BSfXsQBjp1dh4vE ELDCdCklE07m0g0P4+bq1QL3071Nuxx8OOBm4xTleKullPP0hidLCfQMFK1IXhkLeZTS F9Mg== X-Gm-Message-State: AHYfb5jIKSafq3asjCUnVUBo24I4BsVYk0alHTSTM+RESaz4Abh8PllH mNEGfZ53eWyd38eBPpqnGJ+aX2DZdQ== X-Received: by 10.237.53.58 with SMTP id a55mr48381qte.198.1503415136333; Tue, 22 Aug 2017 08:18:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.95.46 with HTTP; Tue, 22 Aug 2017 08:18:55 -0700 (PDT) In-Reply-To: <0ac245f1-002b-2993-c1de-e4ddaafa9c7d@cs.umass.edu> References: <000001d31acd$108b0340$31a109c0$@rogers.com> <0ac245f1-002b-2993-c1de-e4ddaafa9c7d@cs.umass.edu> From: Stephen John Smoogen Date: Tue, 22 Aug 2017 15:19:00 -0000 Message-ID: Subject: Re: alias appears to not work inside a called bash script To: moss@cs.umass.edu, cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00196.txt.bz2 On 22 August 2017 at 10:47, Eliot Moss wrote: > On 8/22/2017 10:31 AM, Stephen John Smoogen wrote: > >> I replicated this problem on my system and found that the fix is to add a >> >> shopt -s expand_aliases >> >> at the top of the script. I don't know why the option is turned off >> when running scripts versus in a plain script but that seems to be a >> default in Cygwin. > > > It's a *bash* default - it has nothing to do with Cygwin as distinct > from other bash installations. If you had a different experience > elsewhere, it could be that the default was overridden in some system > wide bashrc file - but that strikes me as unlikely. I suspect that > this is done as a security measure, to prevent an alias from introducing > a surprise. > I checked on CentOS and there is no shopt option set in any of the /etc/ files. It must be a compiled in default of some sort as EL6 and EL7 both work without an explicit `shopt -s expand_aliases`. I then tried on an Ubuntu 16.04 system and it works without the `shopt -s expand_aliases` also. I didn't have access to anything else at the moment so I can't say which other systems might actually follow the default other than Cygwin at the moment. > Regards - EM > > > -- > 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 > -- Stephen J Smoogen. -- 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