cut: you must specify a list of bytes, characters, or fields

0

x=`sudo find /test -name  "*.php"`
echo $x
p421.php p423.php read-session.php

I want to cut the $x with space white as delimiter

echo $x|cut -d " "
cut: you must specify a list of bytes, characters, or fields

scrapy

Posted 2018-09-25T02:47:32.017

Reputation: 307

Which field do you want to cut out? – Xen2050 – 2018-09-25T05:18:25.337

If you need to cut the output of find you are likely not doing the right thing. To execute a command on the listed files either use find [parms] -exec some command {}\;, or find [parms] | xargs command (syntax will be a bit more complex if you spaces in file names, but given what you are trying to do, likely not). Also, why sudo? With the find -exec form the command is executed as root, while find | xarg executes the command with your id. – xenoid – 2018-09-25T07:06:57.987

No answers