FIND YOUR NEXT FEW LINES

Results for “for”

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

3000 snippets foundClear filters
Bash ScriptsParameter expansion

Extract a basename without an external process

Bash Scripts: Double hash removes the longest matching prefix ending in a slash.

Bash Scripts✓ Tested
Linux CommandsArchives & checksums

Extract a compressed tar archive

Extract a trusted gzip-compressed tar archive into a dedicated destination directory.

tar✓ Tested
Linux CommandsTransforming text

Extract a delimited text column

Linux Commands: Use cut for simple unquoted delimiter-separated text.

Linux Commands✓ Tested
Linux CommandsGetting Started

Extract a field from simple delimited text

Linux Commands: Extract a field from simple delimited text using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Linux CommandsFinding & selecting files

Extract a filename from a path

Linux Commands: Use basename with an explicit suffix when removing a known extension.

Linux Commands✓ Tested
SQLiteJSON data

Extract a JSON field

Read a scalar value from JSON text.

json_extract✓ Tested
PowerShellStrings & literal text

Extract a known substring

PowerShell: Substring uses a zero-based starting index and a character count.

PowerShell✓ Tested
Linux CommandsFinding & selecting files

Extract a parent directory from a path

Linux Commands: Use dirname without needing the path to exist.

Linux Commands✓ Tested
Bash ScriptsParameter expansion

Extract a parent path with parameter expansion

Bash Scripts: Percent removes the shortest matching slash-and-suffix portion.

Bash Scripts✓ Tested
GoHTTP & URLs

Extract a route path variable

Extract a route path variable using a complete Go program with explicit sample inputs.

Go✓ Tested
Arduino / CText & bounded buffers

Extract a section of an Arduino String

Arduino / C: substring includes the start index and excludes the end index.

Arduino / C✓ Tested
Bash ScriptsParameter expansion

Extract a substring by offset and length

Bash Scripts: Bash substring offsets start at zero for an ordinary string.

Bash Scripts✓ Tested