Results for “sed”
Small, practical examples. Search by task or narrow things down below.
Explain a calculation with a comment
C++: Keep the code executable while documenting why a fixed input is used.
C++✓ Tested
Explain a calculation with a comment
C: Keep the code executable while documenting why a fixed input is used.
C✓ Tested
Extract a known substring
PowerShell: Substring uses a zero-based starting index and a character count.
PowerShell✓ Tested
Extract part of a string
Use one-based positions with substr.
substr✓ Tested
Find an element’s position among siblings
jQuery: index without arguments reports a zero-based sibling position.
jQuery✓ Tested
Handle an expected command failure
Branch on a command’s exit code without aborting the script.
exit status✓ Tested
Insert only keys absent from a destination
SQL: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
SQL✓ Tested
Insert only keys absent from a destination
SQL Server: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
SQL Server✓ Tested
Insert only keys absent from a destination
Postgres: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
Postgres✓ Tested
Insert only keys absent from a destination
SQLite: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
SQLite✓ Tested
Insert or update on a key conflict
Use a unique key to update an existing row.
ON CONFLICT✓ Tested
Join array items with a one-character separator
Bash Scripts: A local IFS controls the separator used by the quoted star expansion.
Bash Scripts✓ Tested