Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

newlines

Newlines in filenames

August 11, 2022 by Magenaut

I understand and accept the premise that defensive1 shell scripting is both prudent and, in the longer term, more sustainable.

Categories Q&A, Unix & Linux Tags filenames, newlines, shell-script Leave a comment

How to bulk convert all the file in a file system branch between Unix and Windows line break format?

August 11, 2022 by Magenaut

Everybody knows 🙂 that in Windows plain text files lines are terminated with CR+LF, and in Unix&Linux – with LF only. How can I quickly convert all my source code files from one format to another and back?

Categories Q&A, Unix & Linux Tags newlines, text-processing Leave a comment

Why do newline characters get lost when using command substitution?

August 11, 2022 by Magenaut

The read utility shall read a single line from standard input.

Categories Q&A, Unix & Linux Tags command-substitution, newlines, shell Leave a comment

Remove ^M character from log files

August 11, 2022 by Magenaut

Remove ^M character from log files.

Categories Q&A, Unix & Linux Tags command-line, newlines, shell Leave a comment

Finding all “Non-Binary” files

August 10, 2022 by Magenaut

Is it possible to use the find command to find all the “non-binary” files in a directory? Here’s the problem I’m trying to solve.

Categories Q&A, Unix & Linux Tags files, find, newlines, text Leave a comment

How to detect end of line with sed

August 9, 2022 by Magenaut

I’m looking for a way to only execute replacement when the last character is a newline, using sed.

Categories Q&A, Unix & Linux Tags newlines, regular-expression, sed Leave a comment

sed fails to remove newline character

August 9, 2022 by Magenaut

I’ve been using sed for quite some time but here is a quirk I came around with, which I am not able to resolve.

Categories Q&A, Unix & Linux Tags newlines, sed Leave a comment

How to preserve the newline character (n) when capture output of a command in a variable

August 8, 2022 by Magenaut

As a simple example, I have a bunch of source code files. I want to store the “head” command output to a variable for all these files.

Categories Q&A, Unix & Linux Tags bash, command-substitution, newlines, shell Leave a comment

Script failing with “command not found: ^M”

August 8, 2022 by Magenaut

When I try to run the following script in zsh, via the command /bin/zsh ~/.set_color_scheme.sh I get the following error:

Categories Q&A, Unix & Linux Tags character-encoding, newlines, shell, shell-script, zsh Leave a comment

How to add a carriage return before every newline?

August 7, 2022 by Magenaut

I have a file that only uses n for new lines, but I need it to have rn for each new line. How can I do this?

Categories Q&A, Unix & Linux Tags grep, newlines, sed Leave a comment
Older posts
Page1 Page2 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress