mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 20:11:19 +08:00
@@ -5,11 +5,11 @@
|
||||
|
||||
- Match a variable against string literals to decide which command to run:
|
||||
|
||||
`case {{$COUNTRULE}} in {{words}}) {{wc -w README}} ;; {{lines}}) {{wc -l README}} ;; esac`
|
||||
`case {{$COUNTRULE}} in {{words}}) {{wc --words README}} ;; {{lines}}) {{wc --lines README}} ;; esac`
|
||||
|
||||
- Combine patterns with |, use * as a fallback pattern:
|
||||
|
||||
`case {{$COUNTRULE}} in {{[wW]|words}}) {{wc -w README}} ;; {{[lL]|lines}}) {{wc -l README}} ;; *) {{echo "what?"}} ;; esac`
|
||||
`case {{$COUNTRULE}} in {{[wW]|words}}) {{wc --words README}} ;; {{[lL]|lines}}) {{wc --lines README}} ;; *) {{echo "what?"}} ;; esac`
|
||||
|
||||
- Allow matching multiple patterns:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user