Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pages/common/*: replace unportable shell syntax in command examples #12848

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pages/common/comm.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@

`comm -23 {{file1}} {{file2}} > {{file1_only}}`

- Print lines only found in second file, when the files aren't sorted:
- Print lines only found in the second file, when both files are sorted:

`comm -13 <(sort {{file1}}) <(sort {{file2}})`
`comm -13 {{path/to/sorted_file1}} {{path/to/sorted_file2}}`
2 changes: 1 addition & 1 deletion pages/common/dnsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

- Query all the DNS records (A, AAAA, CNAME, NS, TXT, SRV, PTR, MX, SOA, AXFR, CAA):

`dnsx -recon -re <<< {{example.com}}`
`echo {{example.com}} | dnsx -recon -re`

- Query a specific type of DNS record:

`echo {{example.com}} | dnsx -re -{{a|aaaa|cname|ns|txt|srv|ptr|mx|soa|any|axfr|caa}}`

- Output [r]esponse [o]nly (do not show the queried domain or subdomain):

Check failure on line 20 in pages/common/dnsx.md

View workflow job for this annotation

GitHub Actions / build

esponse ==> response, espouse

`echo {{example.com}} | dnsx -ro`

Expand All @@ -29,7 +29,7 @@

`dnsx -domain {{FUZZ.example.com}} -wordlist {{path/to/wordlist.txt}} -re`

- Brute force DNS records from a list of [d]omains and wordlists, appending [o]utput to a file with [n]o [c]olor codes:

Check failure on line 32 in pages/common/dnsx.md

View workflow job for this annotation

GitHub Actions / build

utput ==> output

`dnsx -domain {{path/to/domain.txt}} -wordlist {{path/to/wordlist.txt}} -re -output {{path/to/output.txt}} -no-color`

Expand Down
2 changes: 1 addition & 1 deletion pages/common/for.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- Iterate over a given range of numbers:

`for {{variable}} in {{{from}}..{{to}}..{{step}}}; do {{echo "Loop is executed"}}; done`
`for {{variable}} in $(seq {{from}} {{to}} {{step}}); do {{echo "Loop is executed"}}; done`

- Iterate over a given list of files:

Expand Down
1 change: 1 addition & 0 deletions pages/common/git-filter-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

> A versatile tool for rewriting Git history.
> See also: `bfg`.
> Note: Process substitution (i.e., `<(...)` and `>(...)`) may not be supported in your shell.
> More information: <https://github.com/newren/git-filter-repo>.

- Replace a sensitive string in all files:
Expand Down
2 changes: 1 addition & 1 deletion pages/common/ifs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- Reset IFS to default:

`IFS=$' \t\n'`
`IFS='<Space><Tab><Newline>'`

- Temporarily change the IFS value in a subshell:

Expand Down
2 changes: 1 addition & 1 deletion pages/common/md-to-clip.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- Convert a tldr-page file to `stdout`:

`md-to-clip --no-file-save <(echo '{{page-content}}')`
`md-to-clip --no-file-save < {{path/to/page.md}}`

- Convert tldr-pages files while recognizing additional placeholders from a specific config:

Expand Down
1 change: 1 addition & 0 deletions pages/common/sops.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# sops

> SOPS (Secrets OPerationS): a simple and flexible tool for managing secrets.
> Note: Process substitution (i.e., `<(...)` and `>(...)`) may not be supported by your shell.
> More information: <https://github.com/mozilla/sops>.

- Encrypt a file:
Expand Down
1 change: 1 addition & 0 deletions pages/common/tee.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# tee

> Read from `stdin` and write to `stdout` and files (or commands).
> Note: Process substitution (i.e., `<(...)` and `>(...)`) may not be supported by your shell.
> More information: <https://www.gnu.org/software/coreutils/tee>.

- Copy `stdin` to each file, and also to `stdout`:
Expand Down