The actual problem is that you're using find | xargs. You may use the nul character to separate the file names: We need xargs for commands, such as cp, that can only.
She Doesn T Love Me Quotes
The End Doesn T Justify The Means Quotes
When They Don T Need You Quotes
Getting xargs unterminated quote when trying to find text in files
It appears that some of your filenames have apostrophes (single quote) in their names.
$ echo * | xargs xargs:.
There are a few solutions to this problem: Xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or new‐ lines, and executes the command (default is. This means you can escape quotes if the quotes are quoted themselves: Luckily, find and xargs have ways around this.
Pass the grep output to sed to escape the quotes for you: There's a simpler and more efficient way, using the native shell prefix/suffix removal feature: This manual page documents the gnu version of xargs. With xargs, you can convert standard input (stdin) into command arguments, allowing for efficient execution of commands that don't read from stdin, and also can be very.
I've tried changing the delimiters to , and \n, but it doesn't seem to make.
The comment by user80168 describes a way to do this directly with cp, without calling cp for every file: Xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash). If you want it to emit quotes, you'll need to escape those. Xargs considers quotes and backslash as special.
You don't use xargs, because you don't need it. I did a web seach for linux utility to add quotes to argument and found. If cmd is omitted, xargs executes /bin/echo. Ok here's how this works:
With xargs, we can use the standard input (such from another command using pipes) as arguments in a command.
Xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the. This wouldn't process quotes etc. Xargs is one of the most powerful commands in linux. I have an issue which can be solved with utility to add quotes to argument and output to standard.
That's something you really don't want to do, even if it looks tempting.