www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/08/22/15:07:22

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=atEStiEL4V0WN6Zr
koxO6bakki65Z4lRfm13+uigtdEYiIRi8ZjaO4HIxFOTJjY5XnWMFX3YRgsdPik3
0aNGTYFZjBnmB4kgvZuiPTpvyAj/jMEGQ6hWrxrImTB4VhMCe2+kRfpG271PrdvT
FPFEEz4BnvvInxW8DLH312CiRvM=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=J+UKIQGKUtDcVD3Bpa27/D
Dm68U=; b=QVaN3+iVwlnWLUU6xHXYgAW7CvO4tm5BVxTWt+Ff7Hxe2OE1YOud8r
dn0PRRW6wvTDJ5+uw65P2JhhT2ad8SPowA1OCYe1Vr72DxEHZsrbC0c8SRD+ZTjN
U+mZh4dvkqlN+rLMRwKFWQfFmo/85nK1IIcKOu2WkdP8vvLaEBcRU=
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=-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
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)
Subject: Re: alias appears to not work inside a called bash script
To: cygwin AT cygwin DOT com
References: <000001d31acd$108b0340$31a109c0$@rogers.com> <CANnLRdgWnygyp36uYmpzq7i3BvgHonL5H8CPy_Vr+wOYmWjp4w AT mail DOT gmail DOT com> <0ac245f1-002b-2993-c1de-e4ddaafa9c7d AT cs DOT umass DOT edu> <CANnLRdgBU-Gact9rTN3cSYVy6UMe83r=EYyVsvwS97k8VuxD6g AT mail DOT gmail DOT com> <99262820-ed21-d20d-8da0-2c0daa29f476 AT gmail DOT com> <772ae5e5-8ed7-76c4-6d4b-cf352504a8cc AT cs DOT umass DOT edu>
From: cyg Simple <cygsimple AT gmail DOT com>
Message-ID: <78f5b6c2-c097-35bf-578d-6f3e45660e78@gmail.com>
Date: Tue, 22 Aug 2017 15:07:05 -0400
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>
X-IsSubscribed: yes

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 <moss AT cs DOT umass DOT edu> 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

- Raw text -


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