Results for “script”
Small, practical examples. Search by task or narrow things down below.
Write a literal multiline block
Bash Scripts: Quoting the heredoc delimiter disables parameter and command expansion inside it.
Bash Scripts✓ Tested
Write a UTF-8 file
Use the built-in Node.js filesystem API to save text.
JavaScript✓ Tested
Write several literal lines
Bash Scripts: Write several literal lines with a small standalone Bash program.
Bash Scripts✓ Tested
Await several independent results
Preserve input order while awaiting multiple promises.
Promise.all✓ Tested
Check that a file is present and nonempty
Test file content availability before reading it.
file check✓ Tested
Check whether input is a nonnegative integer
Reject empty input and nonnumeric characters before arithmetic.
validation✓ Tested
Clean up a temporary directory automatically
Use an EXIT trap so temporary files are removed when the script ends.
mktemp✓ Tested
Commit a staged change
Save a focused revision with a descriptive message.
commit✓ Tested
Convert a string to lowercase
Normalize a text value using Bash expansion.
lowercase✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
Create a native disclosure
Use details and summary to show optional HTML content without JavaScript.
HTML✓ Tested
Create an annotated release tag
Mark a revision with a readable release description.
tag✓ Tested