www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/08/22/10:47:57

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:reply-to:subject:references:to:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=wVeS4WJr/8s89gCq
JSf0t6bYgK3+c4VmpURytUKWaPtJ3S/9BDo94+4RrFMxgGeN/mc07O4QU+RU1QiM
WsjNAGO2tsJk1zM8NS/wUWsT7BgNNWH/sJUrUhntbINO+1hweICeC3R1ql4m+as8
gH0Tf+FG1zYwkd0M4FYVkFMZVYM=
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:reply-to:subject:references:to:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=U0NdgP9Dan8fzJ2GauXMYt
MmvIQ=; b=tV2VyEUKZgreBENrB3XD2mePS6FJsMAXE/6XtTRG+fNEb1OOBVEzDZ
WTPW9Dhk9yBK+Re9rphbeMRLYPWqZ7bNgb46Z0NvLvcnGY5oNMiIClr9zeuBPADw
p5waWOIOOHAsxGzqZaj8tADCyXFJQ0r0sChF5XL726v/rRuAmGvjA=
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=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=
X-HELO: mailsrv.cs.umass.edu
Reply-To: moss AT cs DOT umass DOT edu
Subject: Re: alias appears to not work inside a called bash script
References: <000001d31acd$108b0340$31a109c0$@rogers.com> <CANnLRdgWnygyp36uYmpzq7i3BvgHonL5H8CPy_Vr+wOYmWjp4w AT mail DOT gmail DOT com>
To: cygwin AT cygwin DOT com
From: Eliot Moss <moss AT cs DOT umass DOT edu>
Message-ID: <0ac245f1-002b-2993-c1de-e4ddaafa9c7d@cs.umass.edu>
Date: Tue, 22 Aug 2017 10:47:37 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CANnLRdgWnygyp36uYmpzq7i3BvgHonL5H8CPy_Vr+wOYmWjp4w@mail.gmail.com>
X-IsSubscribed: yes

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.

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

- Raw text -


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