Skip to content

Commit

Permalink
[skip ci] Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
greymd committed Mar 10, 2023
1 parent bb9f7d9 commit cc82ec7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,14 @@ However, this option is not suitable for processing large files because of its h

#### Solid mode with placeholder (`-I <replace-str>`)

However, if you want to use the contents of the hole as an argument of the targeted command, use the `-I` option.
If you want to use the contents of the hole as an argument of the targeted command, use the `-I` option.

```bash
$ echo AAA BBB CCC | teip -f 2 -I @ -- echo '[@]'
AAA [BBB] CCC
```

`<replace-str>` can be any strings, and multiple characters are allowed.
`<replace-str>` can be any strings and multiple characters are allowed.

```bash
$ seq 5 | teip -f 1 -I NUMBER -- awk 'BEGIN{print NUMBER * 3}'
Expand All @@ -547,7 +547,8 @@ $ seq 5 | teip -f 1 -I NUMBER -- awk 'BEGIN{print NUMBER * 3}'
15
```

Please note that `-s` is automatically enabled, Therefore, it is not suitable for processing huge files.
Please note that `-s` is automatically enabled with `-I`.
Therefore, it is not suitable for processing huge files.
In addition, the targeted command does not get any input from stdin.
The targeted command is expected to work without stdin.

Expand All @@ -569,7 +570,7 @@ $ echo AAABBBCCC | teip -og BBB -s -- tr '\n' '@'
AAABBB@CCC
```

The above is an example where the targeted command is a "tr command that converts line field (\x0A) to @".
The above is an example where the targeted command is a "tr command that converts line field (`\x0A`) to @".
"BBB" does not contain a newline, but the result is "BBB@", because implicitly added line breaks have been processed.
To prevent this behavior, use the `--chomp` option.
This option gives the targeted command pure input with no newlines added.
Expand Down

0 comments on commit cc82ec7

Please sign in to comment.