unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh file types
@ 2014-03-04 18:14 John Yates
  2014-03-05  2:47 ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: John Yates @ 2014-03-04 18:14 UTC (permalink / raw)
  To: 16938

[-- Attachment #1: Type: text/plain, Size: 776 bytes --]

#!/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

[-- Attachment #2: Type: text/html, Size: 1135 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh file types
  2014-03-04 18:14 bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh file types John Yates
@ 2014-03-05  2:47 ` Glenn Morris
  2014-03-05 13:21   ` John Yates
  2014-03-05 18:59   ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: Glenn Morris @ 2014-03-05  2:47 UTC (permalink / raw)
  To: John Yates; +Cc: 16938

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh file types
  2014-03-05  2:47 ` Glenn Morris
@ 2014-03-05 13:21   ` John Yates
  2014-03-05 18:59   ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: John Yates @ 2014-03-05 13:21 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 16938

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

Hi Glenn,

Thanks for the quick reply.

On Tue, Mar 4, 2014 at 9:47 PM, Glenn Morris <rgm@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

[-- Attachment #2: Type: text/html, Size: 1436 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh file types
  2014-03-05  2:47 ` Glenn Morris
  2014-03-05 13:21   ` John Yates
@ 2014-03-05 18:59   ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2014-03-05 18:59 UTC (permalink / raw)
  To: 16938-done

Version: 24.4

Glenn Morris wrote:

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

Added.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-05 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 18:14 bug#16938: 24.3.50; Support the Dash shell shebang and .[bd]sh file types John Yates
2014-03-05  2:47 ` Glenn Morris
2014-03-05 13:21   ` John Yates
2014-03-05 18:59   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).