How to support strings with spaces and single quotes #3532
-
I have a simple process to look at the lines of a file, pass them to fzf for selection and then pass them to a script for processing. It currently looks like this:
This works fine for strings that just have spaces such as "Clean the cat litter" and even double quotes such as "Clean the "cat" litter". But it fails with the error "xargs: unterminated quote" if there is single quote like "Clean the cat's litter". Any suggestions on how to make this work with lines that contain single quotes? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
cat current.txt | fzf | tr '\n' '\0' | xargs -0 -I {}
cat current.txt | tr '\n' '\0' | fzf --read0 | xargs -0 -I {} EDIT
cat current.txt | fzf --print0 | xargs -0 -I {} |
Beta Was this translation helpful? Give feedback.
NUL
EDIT
NUL
, making thetr
command redundant.