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:from:date :message-id:subject:to:content-type; q=dns; s=default; b=PRLgx7k BEF9pIgdpfbezgcRzhoAUBQOfAwvwL/u34yhrjQzSZtZMbVxjuCdyMssiODKVtoW zsH61uMUHRqk/bXt0aduh6rzJcseujKuVwWd3jqfc4vcX50G/ogZwOzjnXfHRAWd gWqYJv20sFgxGclVhRdWVorqVeDEOvwoZYIY= 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:from:date :message-id:subject:to:content-type; s=default; bh=/htsna/o7WZ1U ky2f8HO7wGZ/Kw=; b=mcU/rKos6AjFXwkkeYydwHLsghDdRXWnsl8MycOjjnm0i KDjUimlEsOt0yl3mCGRYF/83ZHNFKw63xE+AyOX9f5O3PaomAUHxiCrSUnKwOVYt NNtoj5ZBPze0hnmE3jkvT48bkmI9K3qhWDN/P8MYGrj8dL5ACFoO6Zdd+TEJlg= 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.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 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 In-Reply-To: <0ac245f1-002b-2993-c1de-e4ddaafa9c7d@cs.umass.edu> References: <000001d31acd$108b0340$31a109c0$@rogers.com> <0ac245f1-002b-2993-c1de-e4ddaafa9c7d AT cs DOT umass DOT edu> From: Stephen John Smoogen Date: Tue, 22 Aug 2017 11:18:55 -0400 Message-ID: Subject: Re: alias appears to not work inside a called bash script To: moss AT cs DOT umass DOT edu, cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes 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