GNU bug report logs - #16938
24.3.50; Support the Dash shell shebang and .[bd]sh file types

Previous Next

Package: emacs;

Reported by: John Yates <john <at> yates-sheets.org>

Date: Tue, 4 Mar 2014 18:15:03 UTC

Severity: wishlist

Found in version 24.3.50

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16938 in the body.
You can then email your comments to 16938 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16938; Package emacs. (Tue, 04 Mar 2014 18:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Yates <john <at> yates-sheets.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 04 Mar 2014 18:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Yates <john <at> yates-sheets.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Support the Dash shell shebang and .[bd]sh file types
Date: Tue, 4 Mar 2014 13:14:34 -0500
[Message part 1 (text/plain, inline)]
#!/bin/sh is interpreted inconsistently across platforms.  In the rpm
world it most often maps to /bin/bash.  In the Debian universe it maps
to /bin/dash.  Bash and dash have subtle differences that have bitten
me often enough to cause me now to use precise shebangs (#!/bin/bash or
#!/bin/dash) and to suffix my files with either .bsh or .dsh.

At present emacs' interpreter-mode-alist knows nothing about dash and
its auto-mode-alist is ignorant of both the .bsh and .dsh suffixes.

For interpreter-mode-alist I suggest adding the follow entry:

     ("dash" . sh-mode)


For auto-mode-alist I suggest changing the follow entry:

     ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)

to

     ("\\.[bcdk]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)

/john
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16938; Package emacs. (Wed, 05 Mar 2014 02:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 16938 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: John Yates <john <at> yates-sheets.org>
Cc: 16938 <at> debbugs.gnu.org
Subject: Re: bug#16938: 24.3.50;
 Support the Dash shell shebang and .[bd]sh file types
Date: Tue, 04 Mar 2014 21:47:35 -0500
John Yates wrote:

> For interpreter-mode-alist I suggest adding the follow entry:
>
>      ("dash" . sh-mode)

Sounds good.

> For auto-mode-alist I suggest changing the follow entry:
>
>      ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
>
> to
>
>      ("\\.[bcdk]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)

I've never come across .bsh and .dsh used as extensions in this way.
I find zero examples on two random RHEL6, Debian testing machines.
The only .bsh files are LibreOffice components that are not bash scripts.
So this seems like something for your personal .emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16938; Package emacs. (Wed, 05 Mar 2014 13:22:02 GMT) Full text and rfc822 format available.

Message #11 received at 16938 <at> debbugs.gnu.org (full text, mbox):

From: John Yates <john <at> yates-sheets.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16938 <at> debbugs.gnu.org
Subject: Re: bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh
 file types
Date: Wed, 5 Mar 2014 08:21:03 -0500
[Message part 1 (text/plain, inline)]
Hi Glenn,

Thanks for the quick reply.

On Tue, Mar 4, 2014 at 9:47 PM, Glenn Morris <rgm <at> gnu.org> wrote:

> >      ("dash" . sh-mode)
>
> Sounds good.
>

That's the one that really matters to me as many (most?) of my scripts have
no file extension.

I've never come across .bsh and .dsh used as extensions in this way.
> I find zero examples on two random RHEL6, Debian testing machines.
> The only .bsh files are LibreOffice components that are not bash scripts.
> So this seems like something for your personal .emacs.
>

I guess I suggested .bsh and .dsh for completeness.  My first encounter
with .bsh was on my newest job.  I introduced .dsh once I started using a
#!/bin/dash shebang.  Given that you found a LibreOffice conflict I am
happy to withdraw my suggestion.

/john
[Message part 2 (text/html, inline)]

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Wed, 05 Mar 2014 19:00:02 GMT) Full text and rfc822 format available.

Notification sent to John Yates <john <at> yates-sheets.org>:
bug acknowledged by developer. (Wed, 05 Mar 2014 19:00:04 GMT) Full text and rfc822 format available.

Message #16 received at 16938-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 16938-done <at> debbugs.gnu.org
Subject: Re: bug#16938: 24.3.50;
 Support the Dash shell shebang and .[bd]sh file types
Date: Wed, 05 Mar 2014 13:59:46 -0500
Version: 24.4

Glenn Morris wrote:

>> For interpreter-mode-alist I suggest adding the follow entry:
>>
>>      ("dash" . sh-mode)

Added.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 03 Apr 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.