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
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
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 usefind [parms] -exec some command {}\;
, orfind [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, whysudo
? With thefind -exec
form the command is executed as root, whilefind | xarg
executes the command with your id. – xenoid – 2018-09-25T07:06:57.987