search
HomeDevelopment ToolsnotepadHow to solve the problem that the shell script written in Notepad++ cannot be executed under Linux

How to solve the problem that the shell script written in Notepad++ cannot be executed under Linux

Notepad is a free and open source code editor under Windows environment. Supported languages: C, C, Java, C#, XML, HTML, PHP, Javascript!

This article will explain to you the solution to the problem that the shell script developed under Windows using notepad cannot be executed when uploaded to Linux (bom problem). Interested students can refer to it. (Recommended learning: notepad )

Problem description:

During a debugging shell statement, it was discovered that the shell copied from the notepad text When executed on Linux, there are no errors! But when uploading the shell script written in notepad to the Linux system for debugging, an error that the command cannot be found is reported! After thinking about it, the root cause of the problem must be on Nodepad. After searching for the reason, it turned out to be a problem with format conversion

1. View the current text format

In the Notepad interface, in There is a description of the file format in the lower right corner: "Dos\Windows or UNIX or Mac".

How to solve the problem that the shell script written in Notepad++ cannot be executed under Linux

#2. File conversion method

But if you need to convert like this every time you write a shell file, it may be very troublesome, then there is Is there no permanent solution?

The answer is yes, we can set Notepad to create new files in shell format by default. The specific operations are as follows:

Open in notepad, settings, first Options

How to solve the problem that the shell script written in Notepad++ cannot be executed under Linux

Note:

1 File format, line breaks are different between windows and linux

2 Do not have BOM header in utf8 files

The above is the detailed content of How to solve the problem that the shell script written in Notepad++ cannot be executed under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is notepad What software notepadWhat is notepad What software notepadMar 06, 2025 pm 12:21 PM

This article compares Notepad and Notepad , highlighting Notepad 's superior features for coding. Notepad offers syntax highlighting, code completion, and extensive plugin support, unlike the basic functionality of Notepad. Therefore, Notepad

Introduction to Notepad's functionsIntroduction to Notepad's functionsMar 06, 2025 pm 12:19 PM

Notepad is a free, open-source text and code editor offering syntax highlighting, auto-completion, macro recording, powerful search, and a plugin system. Its advantages over other editors include enhanced code readability, efficient search/replace

What is notepad? What is notepad for?What is notepad? What is notepad for?Mar 06, 2025 pm 12:17 PM

This article describes Notepad, a basic Windows text editor. It details its functions—text editing, saving, opening, and searching—and limitations. While usable for simple text tasks, its lack of syntax highlighting, code completion, and debugging

Notepad How to display data in json formatNotepad How to display data in json formatMar 06, 2025 pm 12:15 PM

This article explains how to improve JSON data readability in Notepad . It focuses on using Notepad 's syntax highlighting and suggests external JSON formatters and validators for reliable formatting and syntax checking, as Notepad lacks built-i

Notepad installation detailed tutorialNotepad installation detailed tutorialMar 06, 2025 pm 12:10 PM

This article explains that Notepad is pre-installed in Windows and requires no installation. It addresses common issues accessing or using Notepad, offering troubleshooting steps. It also details installing the separate, more advanced text editor,

Notepad Setting Chinese Notepad How to Setting ChineseNotepad Setting Chinese Notepad How to Setting ChineseMar 06, 2025 pm 12:18 PM

Notepad lacks built-in language settings. To use Chinese, users must change their operating system's language settings to Chinese (Simplified or Traditional), then restart their computer or Notepad . Notepad 's interface language reflects the

How to convert notepad to json notepad to json shortcut keyHow to convert notepad to json notepad to json shortcut keyMar 06, 2025 pm 12:16 PM

This article explains how to convert unstructured Notepad text to JSON format. It highlights the lack of a direct conversion method, emphasizing the need for manual structuring or scripting (Python, JavaScript) for automation. Spreadsheet software

What is notepadWhat is notepadMar 06, 2025 pm 12:08 PM

Notepad is a free, open-source text and code editor. It excels at code editing via syntax highlighting for numerous languages, and also efficiently handles text editing, web development, and file manipulation. Its extensibility through plugins e

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools