Skip to content
/ nln Public

Simple binary that pipes stdin to stdout, removing any trailing newline

Notifications You must be signed in to change notification settings

glennib/nln

Repository files navigation

nln

Remove trailing newlines and carriage returns from stdin.

Crates.io Version

Installation

Using cargo:

cargo install nln

Using cargo-binstall (faster, no compilation):

cargo binstall nln

Using mise (global):

mise use -g cargo:nln

Or download binaries from releases.

Usage

# Remove trailing newlines
echo -e "hello\n\n" | nln

# Use with files
cat file.txt | nln

# Copy to clipboard without trailing newlines
cat script.sh | nln | pbcopy

The tool preserves newlines within content, only removing trailing ones.

License

MIT

About

Simple binary that pipes stdin to stdout, removing any trailing newline

Resources

Stars

Watchers

Forks