FIND YOUR NEXT FEW LINES

Results for “folder”

Small, practical examples. Search by task or narrow things down below.

667 snippets foundClear filters
Bash ScriptsVariables & text

Remove a filename extension

Keep the path while removing its final extension.

filename✓ Tested
Bash ScriptsParameter expansion

Remove a known prefix with a shell pattern

Bash Scripts: The hash expansion removes the shortest matching prefix without changing the original variable.

Bash Scripts✓ Tested
RustStrings & Unicode

Remove a prefix only when it matches

Remove a prefix only when it matches in a complete Rust program using the standard library.

Rust✓ Tested
GoSlices & collections

Remove a slice range

Remove a slice range using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsText parsing & arithmetic

Remove a trailing carriage return from a line

Bash Scripts: Use an ANSI-C quoted carriage return as the suffix pattern.

Bash Scripts✓ Tested
Bash ScriptsProcesses & environment

Remove a variable from one child’s environment

Bash Scripts: env -u removes an inherited value for a single command.

Bash Scripts✓ Tested
Linux CommandsGetting Started

Remove adjacent duplicate lines

Linux Commands: Remove adjacent duplicate lines using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
RustMaps & sets

Remove an entry and inspect its value

Remove an entry and inspect its value in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsArray operations

Remove an indexed element and compact the array

Bash Scripts: Unsetting an element leaves a gap; reassigning the values creates consecutive indices.

Bash Scripts✓ Tested
GoStrings & text

Remove an optional prefix

Remove an optional prefix using a complete Go program with explicit sample inputs.

Go✓ Tested
RustVectors & slices

Remove and collect a vector range

Remove and collect a vector range in a complete Rust program using the standard library.

Rust✓ Tested
Linux CommandsTransforming text

Remove blank or whitespace-only lines

Linux Commands: Use a POSIX character class so tabs and spaces are handled together.

Linux Commands✓ Tested