mirror of
https://github.com/chmln/sd
synced 2024-11-26 04:50:22 +00:00
Merge pull request #91 from dym-sh/patch-1
edge-case info for strings starting with '--'
This commit is contained in:
commit
03dcd40591
1 changed files with 12 additions and 0 deletions
12
README.md
12
README.md
|
@ -210,3 +210,15 @@ for file in $(fd --type file); do
|
|||
sd 'from "react"' 'from "preact"' "$file";
|
||||
done
|
||||
```
|
||||
|
||||
### Edge cases
|
||||
replace/-with string needs extra `--` before it, if starts with double-minus
|
||||
(this is a limitation of the bash itself)
|
||||
|
||||
```bash
|
||||
echo "test/test" | sd '/' -- '--inteneded--'
|
||||
test--inteneded--test
|
||||
|
||||
echo "start/--/end" | sd --string-mode -- '--' 'middle'
|
||||
start/middle/end
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue