Results for “tr”
Small, practical examples. Search by task or narrow things down below.
Read complete lines into an array
Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.
Bash Scripts✓ Tested
Read CSV rows as dictionaries
Read a CSV file using its header row as dictionary keys, so each column can be accessed by name.
csv✓ Tested
Read from a dedicated file descriptor
Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.
Bash Scripts✓ Tested
Read JSON into a hashtable
PowerShell: AsHashtable produces dictionary-style results for keys that are data rather than fixed property names.
PowerShell✓ Tested
Read null-delimited filenames into an array
Bash Scripts: A null delimiter preserves spaces and embedded newlines in filenames.
Bash Scripts✓ Tested
Read one JSON document per line
Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.
Python✓ Tested
Read the current branch name
Git: show-current returns an empty string when HEAD is detached.
Git✓ Tested
Read the exact version currently staged
Git: The colon path syntax reads a blob from the index rather than from HEAD or the working file.
Git✓ Tested
Read the final array item with a negative index
JavaScript: at supports negative positions counted from the end.
JavaScript✓ Tested
Read the final array item with a negative index
TypeScript: at supports negative positions counted from the end.
TypeScript✓ Tested
Read updated base-table values through a view
SQL: An ordinary view reflects later changes to its underlying data.
SQL✓ Tested
Read updated base-table values through a view
SQL Server: An ordinary view reflects later changes to its underlying data.
SQL Server✓ Tested