Results for “line history”
Small, practical examples. Search by task or narrow things down below.
Read a file without losing its last line
Handle spaces, backslashes, and a final line without a newline.
read lines✓ Tested
Read a line without losing backslashes
Bash Scripts: Read a line without losing backslashes with a small standalone Bash program.
Bash Scripts✓ Tested
Read buffered lines from a file
Read buffered lines from a file in a complete Rust program using the standard library.
Rust✓ Tested
Read complete lines into an array
Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.
Bash Scripts✓ Tested
Read history for one path
Git: Read history for one path inside the disposable repository created by the input setup.
Git✓ Tested
Read one JSON document per line
Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.
Python✓ Tested
Read text line by line
Read text line by line using a complete Go program with explicit sample inputs.
Go✓ Tested
Remove a trailing carriage return from a line
Bash Scripts: Use an ANSI-C quoted carriage return as the suffix pattern.
Bash Scripts✓ Tested
Remove a trailing line ending
Use strcspn to terminate a C string at its first newline or carriage return.
C✓ Tested
Remove adjacent duplicate lines
Linux Commands: Remove adjacent duplicate lines using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested
Remove blank or whitespace-only lines
Linux Commands: Use a POSIX character class so tabs and spaces are handled together.
Linux Commands✓ Tested
Replace text in a pipeline
Linux Commands: Replace text in a pipeline using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested