From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114386 invoked by alias); 22 Aug 2017 19:07:08 -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 114374 invoked by uid 89); 22 Aug 2017 19:07:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=act, his, HContent-Transfer-Encoding:8bit X-HELO: mail-it0-f41.google.com Received: from mail-it0-f41.google.com (HELO mail-it0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Aug 2017 19:07:05 +0000 Received: by mail-it0-f41.google.com with SMTP id x187so210228ite.1 for ; Tue, 22 Aug 2017 12:07:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=O0FbdBFDE2z+WVAY46FPGpnx9h2k1DfzM2WfjLk7Fy0=; b=PGMIvYgnovzLr8ajGmtZCG7KGmKjsToaVJ6ft4abLjTFoExyZRObjKwAZpspmX6uoC q09xlJOjQ0uiKtK3vCvAtr1kOXZ039TC3uxBsTUSjgQ1GXVao0qrF8Bsj/jQ7uBXyE/D SxRVDjXZwco2lM8qzslEzKmlyo8Nt+iii/P6n9aKLSHdSDSREIjXUbk+E+BZ9hYvd+wM eYXwDP7eOL9w8Lgt+K6JYdM7NUPM8yP/FCDaPUdn6dY75Rl2qhWfjUd0C1a22pXrmJQY gnCC7c9AMQPFPA2Y21WGEeb6b/yVAhtTh2qxeZxyDBozvDheXoDVqeTVm61cwG/zCGNQ aI1A== X-Gm-Message-State: AHYfb5i8YrnAfQa+ryIX3PkYRWdpA1aGM8R5Kjl0g2VFMiDTmRzARvza Nrvs9/RUtwkamYeB X-Received: by 10.36.110.145 with SMTP id w139mr984873itc.12.1503428824147; Tue, 22 Aug 2017 12:07:04 -0700 (PDT) Received: from [192.168.0.6] (d4-50-42-50.try.wideopenwest.com. [50.4.50.42]) by smtp.gmail.com with ESMTPSA id b84sm76264iof.73.2017.08.22.12.07.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Aug 2017 12:07:03 -0700 (PDT) Subject: Re: alias appears to not work inside a called bash script To: cygwin@cygwin.com References: <000001d31acd$108b0340$31a109c0$@rogers.com> <0ac245f1-002b-2993-c1de-e4ddaafa9c7d@cs.umass.edu> <99262820-ed21-d20d-8da0-2c0daa29f476@gmail.com> <772ae5e5-8ed7-76c4-6d4b-cf352504a8cc@cs.umass.edu> From: cyg Simple Message-ID: <78f5b6c2-c097-35bf-578d-6f3e45660e78@gmail.com> Date: Tue, 22 Aug 2017 19:07:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <772ae5e5-8ed7-76c4-6d4b-cf352504a8cc@cs.umass.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00202.txt.bz2 On 8/22/2017 1:13 PM, Eliot Moss wrote: > On 8/22/2017 1:07 PM, cyg Simple wrote: >> On 8/22/2017 11:18 AM, Stephen John Smoogen wrote: >>> On 22 August 2017 at 10:47, Eliot Moss wrote: >>>> On 8/22/2017 10:31 AM, Stephen John Smoogen wrote: > >> Are you talking bash as sh or bash as bash?  Bash as sh will expand >> those aliases.  But you should study >> http://tldp.org/LDP/abs/html/aliases.html for all your scripts.  Are >> there environment variables that could affect the outcome? > > Since the OP has a #! /bin/bash line at the top of his script, I think > he means bash.  However, running the script with sh explicitly does act > as you describe, e.g.:  sh myscript x y z ... in contrast to: myscript x > y z. > There's also --posix and set -o posix which will cause bash to perform as the OP reports. I'm guessing this to be used in the bash startup files in a global fashion on those systems that you're not having to specify to use aliases. https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html#Bash-POSIX-Mode -- cyg Simple -- 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