From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118717 invoked by alias); 22 Aug 2017 14:47:44 -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 118701 invoked by uid 89); 22 Aug 2017 14:47:43 -0000 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 Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Aug 2017 14:47:42 +0000 Received: from [128.119.40.245] (csvpn21.cs.umass.edu [128.119.40.245]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 20933401D9AC; Tue, 22 Aug 2017 10:47:40 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: alias appears to not work inside a called bash script References: <000001d31acd$108b0340$31a109c0$@rogers.com> To: cygwin@cygwin.com From: Eliot Moss Message-ID: <0ac245f1-002b-2993-c1de-e4ddaafa9c7d@cs.umass.edu> Date: Tue, 22 Aug 2017 14:47:00 -0000 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00195.txt.bz2 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