mirror of
https://github.com/chmln/sd
synced 2024-10-04 14:39:08 +00:00
edge-case info for strings starting with '--'
This commit is contained in:
parent
987373bdb1
commit
e140b82b3d
12
README.md
12
README.md
|
@ -210,3 +210,15 @@ for file in $(fd --type file); do
|
||||||
sd 'from "react"' 'from "preact"' "$file";
|
sd 'from "react"' 'from "preact"' "$file";
|
||||||
done
|
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