= 1024) {
$event.preventDefault();
const i = slugs.indexOf($wire.preview);
const next = $event.key === 'ArrowDown' ? Math.min(i + 1, slugs.length - 1) : Math.max(i - 1, 0);
if (next !== i && slugs[next]) $wire.openPreview(slugs[next]);
}
">
Installation Guides
11
Knowledge Base
308 copy-ready commands with fill-in variables, plus step-by-step installation guides.
/
Categories
12 results
= 1024) { $event.preventDefault(); $wire.openPreview('bash-shebang-strict') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-shebang-strict') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Script Header with Strict Mode
#!/usr/bin/env bash
#bash
#shebang
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-if-else') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-if-else') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
If/Else Conditional
if [[ "${{variable}}" == "{{value}}" ]]; then
#bash
#if
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-for-loop') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-for-loop') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
For Loop Over List
for {{item}} in {{list}}; do
#bash
#for
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-while-loop') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-while-loop') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
While Loop
while [[ {{condition}} ]]; do
#bash
#while
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-function-define') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-function-define') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Define a Function
{{function_name}}() {
#bash
#function
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-variable-default') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-variable-default') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Variable with Default Value
{{variable}}="${{variable}:-{{default_value}}}"
#bash
#variable
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-check-file-exists') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-check-file-exists') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Check if File or Directory Exists
if [[ -f "{{path}}" ]]; then
#bash
#file
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-read-env-file') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-read-env-file') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Load .env File into Script
set -o allexport
#bash
#env
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-trap-error') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-trap-error') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Trap Errors and Cleanup
cleanup() {
#bash
#trap
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-log-with-timestamp') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-log-with-timestamp') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Log Messages with Timestamp
log() {
#bash
#logging
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-exit-on-fail') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-exit-on-fail') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Exit Script on Command Failure
{{command}} || { echo "ERROR: {{command}} failed"; exit 1; }
#bash
#exit
3 views
0 copies
= 1024) { $event.preventDefault(); $wire.openPreview('bash-array-iterate') }"
class="absolute inset-0 z-0 rounded-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500">
= 1024) { $event.preventDefault(); $wire.openPreviewWithPicker('bash-array-iterate') }"
class="absolute top-2 end-2 z-10 p-1.5 rounded-md transition text-gray-300 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 hover:text-amber-400"
title="Save to collection">
Bash Scripting
Declare and Iterate an Array
declare -a {{array_name}}=("value1" "value2" "value3")
#bash
#array
3 views
0 copies