Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:06:43+00:00 2026-05-14T07:06:43+00:00

I have to use windows to write some shell scripts. I decided to use

  • 0

I have to use windows to write some shell scripts. I decided to use emacs, but I get a weird error when running the script:

/bin/bash^M: bad interpreter: No such file or directory

Correct me if I’m wrong, but that looks like the shebang ends in \r\n instead of just \n. How can I tell emacs to only write \n? I’m in Shell-script major mode. It’s quite surprising this isn’t fixed by default.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:06:43+00:00Added an answer on May 14, 2026 at 7:06 am

    As Jürgen mentioned, you need to use the set-buffer-file-coding-system. You can say

    (set-buffer-file-coding-system 'unix)
    

    and stick that into a function inside the find-file-hook so that it will set it for all the buffers you open. Alternatively, you can put it inside the write-file-hook list so that the file-coding-system is set properly before you dump the file to disk.

    For a simpler way out, if you’re using the GUI version of Emacs, you can click on the 3rd character in the modeline from the left. It’s to toggle between eol formats.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Unfortunately I have to use Windows Server 2003 on my 32 bit workstation due
I am trying to use Windows Workflow and have a model that looks similar
I have a FBA website and then I extended it (to use Windows Authentication)
I have a .NET Framework 2.0 app and would like to use the Windows
I have my Windows Application that accepts args and I use this in order
We have a Windows Server Web Edition 2003 Web Farm. What can we use
I use a non-default Windows colour scheme on most of my machines, and have
I have a Windows application written in C++ that occasionally evaporates. I use the
I have a .NET 2.0 windows forms app, which makes heavy use of the
I have c# that will run in a windows service. I'm trying to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.