FIND YOUR NEXT FEW LINES

Results for “scope”

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

22 snippets foundClear filters
Docker / ComposeNetworks & volume metadata

Assign a network-scoped alias

Docker / Compose: An alias gives an endpoint an additional name on that network.

Docker / Compose✓ Tested
RustThreads & shared ownership

Borrow local data in a scoped thread

Borrow local data in a scoped thread in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsGetting Started

Limit a beginner function variable to local scope

Bash Scripts: Limit a beginner function variable to local scope with a small standalone Bash program.

Bash Scripts✓ Tested
C++Ownership & optional values

Run cleanup through a scoped destructor

C++: A stack object’s destructor runs when its scope exits, including normal exception unwinding.

C++✓ Tested
AngularComponents & communication

Scope a component’s styles

Scope a component’s styles with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
SQL ServerTransactions & tables

Use a session-scoped temporary table

Store intermediate rows in a local # table.

temporary table✓ Tested
Bash ScriptsFunction scope & composition

Capture output while handling a failed command

Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.

Bash Scripts✓ Tested
Bash ScriptsFunction scope & composition

Give a function its own positional parameters

Bash Scripts: A function receives its call arguments without replacing the caller’s positional parameters.

Bash Scripts✓ Tested
Bash ScriptsFunction scope & composition

Isolate variable changes in a subshell

Bash Scripts: Parentheses create a subshell whose variable assignments do not change the parent.

Bash Scripts✓ Tested
Bash ScriptsFunction scope & composition

Keep a function variable local

Bash Scripts: Local prevents an ordinary function assignment from replacing a caller variable.

Bash Scripts✓ Tested
PowerShellFunctions & parameter validation

Keep function-local assignments separate from caller state

PowerShell: Ordinary function assignments create local variables rather than replacing the caller’s variable.

PowerShell✓ Tested
Bash ScriptsFunction scope & composition

Load functions from a trusted local script

Bash Scripts: Source executes a file in the current shell so its function definitions remain available.

Bash Scripts✓ Tested