Results for “Limits & process security”
Small, practical examples. Search by task or narrow things down below.
Preserve a failure status while an EXIT trap runs
Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.
Bash Scripts✓ Tested
Read an ISO week date
Linux Commands: Use ISO week year, week number, and weekday directives together.
Linux Commands✓ Tested
Remove a variable from one child’s environment
Bash Scripts: env -u removes an inherited value for a single command.
Bash Scripts✓ Tested
Set a service’s open-file limit
Docker / Compose: The ulimits mapping defines soft and hard resource limits.
Docker / Compose✓ Tested
Set an environment value for one child command
Bash Scripts: A command-prefix assignment is visible to that command without overwriting the shell’s current variable.
Bash Scripts✓ Tested
Start a command with a minimal environment
Linux Commands: Use env -i with an explicit PATH for a controlled child environment.
Linux Commands✓ Tested
Wait for a background job before reading its output
Bash Scripts: Save the job PID and wait explicitly before consuming files it produces.
Bash Scripts✓ Tested
Set no-new-privileges in Compose
Docker / Compose: security_opt configures the process privilege restriction.
Docker / Compose✓ Tested
Accept one typed value at a time from a pipeline
PowerShell: An advanced function uses process to handle each pipeline item.
PowerShell✓ Tested
Check whether text is valid JSON
Reject malformed input before processing it.
json_valid✓ Tested
Copy a file into a created container
Docker / Compose: docker cp can copy into a container before its process starts.
Docker / Compose✓ Tested
Count lines in a file
Count newline characters in a text file, printing only the count without the filename.
lines✓ Tested