delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/14/14:35:29

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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=t3A2WIiHkUa7IBkm
b7vpozyNnsvR5n0ULFgx07XtJy8r+Az3UvQEVVZJ1HguGQRGCdbCmxhZ6N1bNAJ8
96eeQV+m9V/ZxP+BVLCxsj9waT4QVKjgJbApQDelPV4x6n1mR9WjkHd4FYd6a/ki
osFObslGga2Puw8L5bYHdijCs/Q=
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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=1bQpwJpiSTlWf+aEAuarz7
FOX1c=; b=leVa7nhGuEeKUOFiG0YAdBgyW52RmS5Do55PHuZ/jbsmpl1VBQa3fW
At5KVUDAXqIq4v+PH/cxOHdAGnmbYDceYITIEbf5pOl3iyAEQ//4nOy8Z26BFUuE
5i3TolE88KcUJYu+uojJi2zgWu906GDNW2F0EjdMneXSY/P3HU7fM=
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=4.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2
X-HELO: smtp.ht-systems.ru
Date: Wed, 14 Oct 2015 21:27:02 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <85116059.20151014212702@yandex.ru>
To: Adam Dinwoodie <cygwin AT cygwin DOT com>, cygwin AT cygwin DOT com
Subject: Re: [Attn: base-files maintainer] Changing /etc/profile to add more shell-dependent settings
In-Reply-To: <20151014171400.GP14466@dinwoodie.org>
References: <20151014155256 DOT GN14466 AT dinwoodie DOT org> <876129s86w DOT fsf AT Rainer DOT invalid> <20151014171400 DOT GP14466 AT dinwoodie DOT org>
MIME-Version: 1.0
X-IsSubscribed: yes

Greetings, Adam Dinwoodie!

> That, however, doesn't give me anywhere to put the Bash fzf script.
> It's not POSIX compliant, so I don't want to use ".sh".  I can't
> find any directory other than /etc/profile.d that Bash trawls, though.

If my opinion matters, I would advocate making scripts POSIX compliant, unless
there's strong reason to explicitly require shell-dependent functionality.

> The only other option I can think of is to rename the .bash file to .sh
> and to patch it to check $BASH_VERSION before running the Bash-specific
> code.  That seems fragile though -- it means putting Bashisms in a
> script that may be run by non-Bash shells (even if it's gated by
> checking $BASH_VERSION), and it means a patch of the upstream fzf Bash
> script in a way that's essentially just duplicating code already in
> /etc/profile.

> (The upstream solution to this is to add code to the user's ~/.bashrc to
> source the relevant scripts, but I don't think that's feasible when
> installing the scripts via setup-*.exe.)

It isn't feasible at all, touching user's profile scripts is a ready recipe
for disaster.


-- 
With best regards,
Andrey Repin
Wednesday, October 14, 2015 21:25:05

Sorry for my terrible english...


--
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