diff --git a/tldr/case b/tldr/case index d022f745..7bc317a4 100644 --- a/tldr/case +++ b/tldr/case @@ -10,8 +10,16 @@ source: https://github.com/tldr-pages/tldr.git - Match a variable against string literals to decide which command to run: -`case {{$tocount}} in {{words}}) {{wc -w README}}; ;; {{lines}}) {{wc -l README}}; ;; esac` +`case {{$COUNTRULE}} in {{words}}) {{wc -w README}} ;; {{lines}}) {{wc -l README}} ;; esac` - Combine patterns with |, use * as a fallback pattern: -`case {{$tocount}} in {{[wW]|words}}) {{wc -w README}}; ;; {{[lL]|lines}}) {{wc -l README}}; ;; *) {{echo "what?"}}; ;; esac` +`case {{$COUNTRULE}} in {{[wW]|words}}) {{wc -w README}} ;; {{[lL]|lines}}) {{wc -l README}} ;; *) {{echo "what?"}}; ;; esac` + +- Allow matching multiple patterns: + +`case {{$ANIMAL}} in {{cat}}) echo "It's a cat" ;;& {{cat|dog}}) echo "It's a cat or a dog" ;;& *) echo "Fallback" ;; esac` + +- Continue to the next pattern's commands without checking the pattern: + +`case {{$ANIMAL}} in {{cat}}) echo "It's a cat" ;& {{dog}}) echo "It's either a dog or cat fell through" ;& *) echo "Fallback" ;; esac` diff --git a/tldr/fc-list b/tldr/fc-list index 7978eee3..03fd24b8 100644 --- a/tldr/fc-list +++ b/tldr/fc-list @@ -19,3 +19,11 @@ source: https://github.com/tldr-pages/tldr.git - Return the number of installed fonts in your system: `fc-list | wc -l` + +- Return a list of installed fonts that support the language based on its locale code: + +`fc-list :lang={{jp}}` + +- Return a list of installed fonts that contain the glyph specified by its Unicode code-point: + +`fc-list :charset={{f303}}` diff --git a/tldr/if b/tldr/if index 3c495490..29f6e839 100644 --- a/tldr/if +++ b/tldr/if @@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git - List all possible conditions (`test` is an alias to `[`; both are commonly used with `if`): -`man [` +`man test` diff --git a/tldr/kubectl-wait b/tldr/kubectl-wait new file mode 100644 index 00000000..863f6529 --- /dev/null +++ b/tldr/kubectl-wait @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kubectl wait + +> Wait for resource(s) to reach a certain state. +> More information: . + +- Wait for a deployment to become available: + +`kubectl wait --for=condition=available deployment/{{deployment_name}}` + +- Wait for all pods with a certain [l]abel to be ready: + +`kubectl wait --for=condition=ready pod -l {{label_key}}={{label_value}}` + +- Wait for a pod to be deleted: + +`kubectl wait --for=delete pod {{pod_name}}` + +- Wait for a job to complete, within 120 seconds (if the condition isn't met on time, the exit status will be unsuccessful): + +`kubectl wait --for=condition=complete job/{{job_name}} --timeout 120s` diff --git a/tldr/linux/scriptlive b/tldr/linux/scriptlive new file mode 100644 index 00000000..4f6bf5ec --- /dev/null +++ b/tldr/linux/scriptlive @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# scriptlive + +> Execute a typescript created by the `script` command in real-time. +> See also: `script`. +> More information: . + +- Execute a typescript in real-time: + +`scriptlive {{path/to/timing_file}} {{path/to/typescript}}` + +- Execute a typescript at double the original speed: + +`scriptlive {{path/to/timing_file}} {{path/to/typescript}} --divisor 2` + +- Execute a typescript created using `--log-in` option of `script`: + +`scriptlive --log-in {{path/to/stdin_log_file}} {{path/to/typescript}}` + +- Execute a typescript waiting at most 2 seconds between each command: + +`scriptlive {{path/to/timing_file}} {{path/to/typescript}} --maxdelay 2`