The command âfindâ output an error message
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I would like to inquire about an error message that I get when I run the command "find". In the following paragraph, I will explain what I am trying to accomplish.
I have a parent folder. Inside this folder there are many subfolders. Inside each subfolder there are plenty of sub-sub folders. I would like to list the sub-sub folders that contain a specific number of files. I ran for loop as follows:
#!/bin/bash
in=PATH_TO_THE_PARENT_FOLDER
for i in $in/*; do
find $i -maxdepth 1 -type d -print0 | xargs -0 -I sh -c 'echo -e $(find | wc -l) ' | sort -n | grep -w 69 | awk 'print $2' #69 represent the total number of files within a folder
done
This code output the following error message "sh: MPR_Range: No such file or directory". I Googled looking for an explanation for what "sh: MPR_Range" means, but I couldn't find any answer.
shell find
add a comment |Â
up vote
0
down vote
favorite
I would like to inquire about an error message that I get when I run the command "find". In the following paragraph, I will explain what I am trying to accomplish.
I have a parent folder. Inside this folder there are many subfolders. Inside each subfolder there are plenty of sub-sub folders. I would like to list the sub-sub folders that contain a specific number of files. I ran for loop as follows:
#!/bin/bash
in=PATH_TO_THE_PARENT_FOLDER
for i in $in/*; do
find $i -maxdepth 1 -type d -print0 | xargs -0 -I sh -c 'echo -e $(find | wc -l) ' | sort -n | grep -w 69 | awk 'print $2' #69 represent the total number of files within a folder
done
This code output the following error message "sh: MPR_Range: No such file or directory". I Googled looking for an explanation for what "sh: MPR_Range" means, but I couldn't find any answer.
shell find
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would like to inquire about an error message that I get when I run the command "find". In the following paragraph, I will explain what I am trying to accomplish.
I have a parent folder. Inside this folder there are many subfolders. Inside each subfolder there are plenty of sub-sub folders. I would like to list the sub-sub folders that contain a specific number of files. I ran for loop as follows:
#!/bin/bash
in=PATH_TO_THE_PARENT_FOLDER
for i in $in/*; do
find $i -maxdepth 1 -type d -print0 | xargs -0 -I sh -c 'echo -e $(find | wc -l) ' | sort -n | grep -w 69 | awk 'print $2' #69 represent the total number of files within a folder
done
This code output the following error message "sh: MPR_Range: No such file or directory". I Googled looking for an explanation for what "sh: MPR_Range" means, but I couldn't find any answer.
shell find
I would like to inquire about an error message that I get when I run the command "find". In the following paragraph, I will explain what I am trying to accomplish.
I have a parent folder. Inside this folder there are many subfolders. Inside each subfolder there are plenty of sub-sub folders. I would like to list the sub-sub folders that contain a specific number of files. I ran for loop as follows:
#!/bin/bash
in=PATH_TO_THE_PARENT_FOLDER
for i in $in/*; do
find $i -maxdepth 1 -type d -print0 | xargs -0 -I sh -c 'echo -e $(find | wc -l) ' | sort -n | grep -w 69 | awk 'print $2' #69 represent the total number of files within a folder
done
This code output the following error message "sh: MPR_Range: No such file or directory". I Googled looking for an explanation for what "sh: MPR_Range" means, but I couldn't find any answer.
shell find
edited Jun 6 at 15:57
asked Jun 6 at 13:35
goro
78841533
78841533
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Assume you have a file called foo&bar
. xargs
will now run the command
sh -c 'echo -e $(find foo&bar | wc -l) foo&bar'
That runs echo
and find
in the background, and two copies of bar
. Similarly for foo;bar
, and $(bar)
.
Don't use in the argument to
sh -c
, instead, give the filename as a separate argument, i.e.
... |xargs sh -c 'echo -e $(find "$1" |ÃÂ wc -l) "$1"' sh | ...
In addition, you could use find -exec
instead of xargs
:
find -type d -exec sh -c 'echo ...' ;
I'm also not exactly sure if the sort
is necessary, if you running grep
to find lines with particular numbers anyway.
1
@goro, of course, for that to produce that error, you'd need to have some file withMPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation here
â ilkkachu
Jun 6 at 16:03
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Assume you have a file called foo&bar
. xargs
will now run the command
sh -c 'echo -e $(find foo&bar | wc -l) foo&bar'
That runs echo
and find
in the background, and two copies of bar
. Similarly for foo;bar
, and $(bar)
.
Don't use in the argument to
sh -c
, instead, give the filename as a separate argument, i.e.
... |xargs sh -c 'echo -e $(find "$1" |ÃÂ wc -l) "$1"' sh | ...
In addition, you could use find -exec
instead of xargs
:
find -type d -exec sh -c 'echo ...' ;
I'm also not exactly sure if the sort
is necessary, if you running grep
to find lines with particular numbers anyway.
1
@goro, of course, for that to produce that error, you'd need to have some file withMPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation here
â ilkkachu
Jun 6 at 16:03
add a comment |Â
up vote
3
down vote
accepted
Assume you have a file called foo&bar
. xargs
will now run the command
sh -c 'echo -e $(find foo&bar | wc -l) foo&bar'
That runs echo
and find
in the background, and two copies of bar
. Similarly for foo;bar
, and $(bar)
.
Don't use in the argument to
sh -c
, instead, give the filename as a separate argument, i.e.
... |xargs sh -c 'echo -e $(find "$1" |ÃÂ wc -l) "$1"' sh | ...
In addition, you could use find -exec
instead of xargs
:
find -type d -exec sh -c 'echo ...' ;
I'm also not exactly sure if the sort
is necessary, if you running grep
to find lines with particular numbers anyway.
1
@goro, of course, for that to produce that error, you'd need to have some file withMPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation here
â ilkkachu
Jun 6 at 16:03
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Assume you have a file called foo&bar
. xargs
will now run the command
sh -c 'echo -e $(find foo&bar | wc -l) foo&bar'
That runs echo
and find
in the background, and two copies of bar
. Similarly for foo;bar
, and $(bar)
.
Don't use in the argument to
sh -c
, instead, give the filename as a separate argument, i.e.
... |xargs sh -c 'echo -e $(find "$1" |ÃÂ wc -l) "$1"' sh | ...
In addition, you could use find -exec
instead of xargs
:
find -type d -exec sh -c 'echo ...' ;
I'm also not exactly sure if the sort
is necessary, if you running grep
to find lines with particular numbers anyway.
Assume you have a file called foo&bar
. xargs
will now run the command
sh -c 'echo -e $(find foo&bar | wc -l) foo&bar'
That runs echo
and find
in the background, and two copies of bar
. Similarly for foo;bar
, and $(bar)
.
Don't use in the argument to
sh -c
, instead, give the filename as a separate argument, i.e.
... |xargs sh -c 'echo -e $(find "$1" |ÃÂ wc -l) "$1"' sh | ...
In addition, you could use find -exec
instead of xargs
:
find -type d -exec sh -c 'echo ...' ;
I'm also not exactly sure if the sort
is necessary, if you running grep
to find lines with particular numbers anyway.
answered Jun 6 at 14:09
ilkkachu
47.7k668131
47.7k668131
1
@goro, of course, for that to produce that error, you'd need to have some file withMPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation here
â ilkkachu
Jun 6 at 16:03
add a comment |Â
1
@goro, of course, for that to produce that error, you'd need to have some file withMPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation here
â ilkkachu
Jun 6 at 16:03
1
1
@goro, of course, for that to produce that error, you'd need to have some file with
MPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation hereâ ilkkachu
Jun 6 at 16:03
@goro, of course, for that to produce that error, you'd need to have some file with
MPR_Range
and other appropriate characters in the file name, but that looks like it would be the most likely explanation hereâ ilkkachu
Jun 6 at 16:03
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448206%2fthe-command-find-output-an-error-message%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password