1
0
mirror of https://github.com/chmln/sd synced 2024-07-05 15:18:35 +00:00

edge-case info for strings starting with '--'

This commit is contained in:
Dym Sohin 2020-07-20 09:53:23 +02:00 committed by GitHub
parent 987373bdb1
commit e140b82b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
```