Skip to content

Instantly share code, notes, and snippets.

@mtvbrianking
Created December 26, 2021 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mtvbrianking/addf264518d7d76a2c681aa7b3457110 to your computer and use it in GitHub Desktop.
Save mtvbrianking/addf264518d7d76a2c681aa7b3457110 to your computer and use it in GitHub Desktop.
bash command stdin arguments options
bash arguments options stdin flags
required
optional
./cmd arg1 agr2 --debug --output=test.txt
Args:
- arg1
- arg2
...args are ordered == because they are read by position
...the 1st arg may be passed as stdin then piped to the command
Options
- o|output
...options can be abbr|word
...options can be required or optional
Flags
- v|verbose
...flags are options that just need to exist, their values ain't used
Example
sign message -k="private.key" -o="secret.txt"
sign message -k="private.key" -o="secret.txt" -v
sign message --key="private.key" --output="secret.txt" --verbose
echo "message" | sign --key="private.key" --output="secret.txt" --verbose
echo "message" | sign --key="private.key" 1> secret.txt
echo "message" | sign --key="private.key" 1> secret.txt 2> signing.err.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment