From 2a1f3e57837437d934b09741836a652c495fa07d Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 29 Dec 2022 21:46:49 +0100 Subject: [PATCH] Added TL;DR to print only exported variables --- knowledge base/bash.md | 3 +++ knowledge base/zsh.md | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/knowledge base/bash.md b/knowledge base/bash.md index 7fe24c2..5ea7795 100644 --- a/knowledge base/bash.md +++ b/knowledge base/bash.md @@ -10,6 +10,9 @@ function functionName { … } # Declare functions on a single line. functionName () { command1 ; … ; command N ; } +# Print exported variables only. +export -p + # Run a command or function on exit, kill or error. trap "rm -f $tempfile" EXIT SIGTERM ERR trap function-name EXIT SIGTERM ERR diff --git a/knowledge base/zsh.md b/knowledge base/zsh.md index 1510641..5924eb5 100644 --- a/knowledge base/zsh.md +++ b/knowledge base/zsh.md @@ -23,8 +23,8 @@ 9. [Frameworks](#frameworks) 10. [Plugins](#plugins) 11. [Troubleshooting](#troubleshooting) - 1. [The delete, end and/or home keys are not working as intended](#the-delete-end-andor-home-keys-are-not-working-as-intended) - 2. [Compinit warnings of insecure directories and files](#compinit-warnings-of-insecure-directories-and-files) + 1. [The delete, end and/or home keys are not working as intended](#the-delete-end-andor-home-keys-are-not-working-as-intended) + 2. [Compinit warnings of insecure directories and files](#compinit-warnings-of-insecure-directories-and-files) 12. [Further readings](#further-readings) ## TL;DR @@ -71,6 +71,9 @@ ls **/*(-@) # Print all shell and environment variables. setopt posixbuiltins && set +# Print exported variables only. +export -p + # Make entries unique in an array. typeset -aU path