find: combining multiple “-exec” statements not working with toybox / Android?Where can I find Android source code online?Android: combining text & image on a Button or ImageButtonAndroid SDK installation doesn't find JDKFind and replace in file and overwrite file doesn't work, it empties the fileBash find: changing matched name for use in -execCan't Find Theme.AppCompat.Light for New Android ActionBar SupportCopying Files that have been modified in the last 5 days to a new folderlinux find -exec two commands and concatenate on same lineRuntime.getRuntime().exec() to use command-line in android app
Did Snape really give Umbridge a fake Veritaserum potion that Harry later pretended to drink?
Need SQL Server VLAN advice.. is it best practice to have all SQL Servers under 1 VLAN/network zone?
Turing Machines: What is the difference between recognizing, deciding, total, accepting, rejecting?
My mother co-signed for my car. Can she take it away from me if I am the one making car payments?
Magento 2: I am not aware about magneto optimization. Can you please share the steps for this?
What caused the flashes in the video footage of Chernobyl?
C++20 with u8, char8_t and std::string
What do you call the angle of the direction of an airplane?
Can the word "coexist" be used for more than two things/people/subjects/... etc?
Can you move between the attacks of a Twinned Booming Blade
Should I hide my travel history to the UK when I apply for an Australian visa?
Cartoon where characters would fight with capsule gauntlets that shoot out small creatures
How long had Bertha Mason been in the attic at the point of the events in Jane Eyre
Is my background sufficient to start Quantum Computing
Do I need to be legally qualified to install a Hive smart thermostat?
Do human thoughts interact with matter?
List of Implementations for common OR problems
What is the right way to query an I2C device from an interrupt service routine?
Why would a propellor have blades of different lengths?
How frequently do Russian people still refer to others by their patronymic (отчество)?
Did Winston Churchill praise Rolls-Royce engines?
Sleepy tired vs physically tired
Term for a character that only exists to be talked to
How to widen the page
find: combining multiple “-exec” statements not working with toybox / Android?
Where can I find Android source code online?Android: combining text & image on a Button or ImageButtonAndroid SDK installation doesn't find JDKFind and replace in file and overwrite file doesn't work, it empties the fileBash find: changing matched name for use in -execCan't Find Theme.AppCompat.Light for New Android ActionBar SupportCopying Files that have been modified in the last 5 days to a new folderlinux find -exec two commands and concatenate on same lineRuntime.getRuntime().exec() to use command-line in android app
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to figure this out on an Android phone running Oreo / 8.0, with toybox 0.7.3-android.
I am trying to get a list of files inside a folder and their respective mtime. I am running this command:
find . -type f -exec stat -c %n ; -exec stat -c %y ;
or
find . -type f -exec stat -c %n "" ; -exec stat -c %y "" ;
In both cases I am only getting the result from the first invocation of "stat". Am I overseeing something or is this the way toybox works on Android?
android linux shell toybox
add a comment |
I am trying to figure this out on an Android phone running Oreo / 8.0, with toybox 0.7.3-android.
I am trying to get a list of files inside a folder and their respective mtime. I am running this command:
find . -type f -exec stat -c %n ; -exec stat -c %y ;
or
find . -type f -exec stat -c %n "" ; -exec stat -c %y "" ;
In both cases I am only getting the result from the first invocation of "stat". Am I overseeing something or is this the way toybox works on Android?
android linux shell toybox
1
I think it's a bug in toybox as it doesn't work with the newest binary, though it runs with busybox.
– TJJ
Mar 25 at 18:43
It definitely is a bug. I reported it and it got already fixed. Unfortunately, this won't help me on Android until this version of toybox makes it into the firmware.
– TJJ
Mar 26 at 15:29
add a comment |
I am trying to figure this out on an Android phone running Oreo / 8.0, with toybox 0.7.3-android.
I am trying to get a list of files inside a folder and their respective mtime. I am running this command:
find . -type f -exec stat -c %n ; -exec stat -c %y ;
or
find . -type f -exec stat -c %n "" ; -exec stat -c %y "" ;
In both cases I am only getting the result from the first invocation of "stat". Am I overseeing something or is this the way toybox works on Android?
android linux shell toybox
I am trying to figure this out on an Android phone running Oreo / 8.0, with toybox 0.7.3-android.
I am trying to get a list of files inside a folder and their respective mtime. I am running this command:
find . -type f -exec stat -c %n ; -exec stat -c %y ;
or
find . -type f -exec stat -c %n "" ; -exec stat -c %y "" ;
In both cases I am only getting the result from the first invocation of "stat". Am I overseeing something or is this the way toybox works on Android?
android linux shell toybox
android linux shell toybox
asked Mar 25 at 17:51
TJJTJJ
1328 bronze badges
1328 bronze badges
1
I think it's a bug in toybox as it doesn't work with the newest binary, though it runs with busybox.
– TJJ
Mar 25 at 18:43
It definitely is a bug. I reported it and it got already fixed. Unfortunately, this won't help me on Android until this version of toybox makes it into the firmware.
– TJJ
Mar 26 at 15:29
add a comment |
1
I think it's a bug in toybox as it doesn't work with the newest binary, though it runs with busybox.
– TJJ
Mar 25 at 18:43
It definitely is a bug. I reported it and it got already fixed. Unfortunately, this won't help me on Android until this version of toybox makes it into the firmware.
– TJJ
Mar 26 at 15:29
1
1
I think it's a bug in toybox as it doesn't work with the newest binary, though it runs with busybox.
– TJJ
Mar 25 at 18:43
I think it's a bug in toybox as it doesn't work with the newest binary, though it runs with busybox.
– TJJ
Mar 25 at 18:43
It definitely is a bug. I reported it and it got already fixed. Unfortunately, this won't help me on Android until this version of toybox makes it into the firmware.
– TJJ
Mar 26 at 15:29
It definitely is a bug. I reported it and it got already fixed. Unfortunately, this won't help me on Android until this version of toybox makes it into the firmware.
– TJJ
Mar 26 at 15:29
add a comment |
1 Answer
1
active
oldest
votes
If toybox can't do multiple exec
, there are alternatives.
In this particular case, you may be able to just use a single stat:
find . -type f -exec stat -c "$(echo -e "%nn%y")" ;
# or just insert the newline verbatim in single quotes:
find . -type f -exec stat -c '%n
%y' ;
For running multiple commands (assuming paths don't contain newlines):
find . -type f -print | while IFS= read -r f; do
stat -c $n "$f";
stat -c %y "$f";
done
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343812%2ffind-combining-multiple-exec-statements-not-working-with-toybox-android%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If toybox can't do multiple exec
, there are alternatives.
In this particular case, you may be able to just use a single stat:
find . -type f -exec stat -c "$(echo -e "%nn%y")" ;
# or just insert the newline verbatim in single quotes:
find . -type f -exec stat -c '%n
%y' ;
For running multiple commands (assuming paths don't contain newlines):
find . -type f -print | while IFS= read -r f; do
stat -c $n "$f";
stat -c %y "$f";
done
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
add a comment |
If toybox can't do multiple exec
, there are alternatives.
In this particular case, you may be able to just use a single stat:
find . -type f -exec stat -c "$(echo -e "%nn%y")" ;
# or just insert the newline verbatim in single quotes:
find . -type f -exec stat -c '%n
%y' ;
For running multiple commands (assuming paths don't contain newlines):
find . -type f -print | while IFS= read -r f; do
stat -c $n "$f";
stat -c %y "$f";
done
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
add a comment |
If toybox can't do multiple exec
, there are alternatives.
In this particular case, you may be able to just use a single stat:
find . -type f -exec stat -c "$(echo -e "%nn%y")" ;
# or just insert the newline verbatim in single quotes:
find . -type f -exec stat -c '%n
%y' ;
For running multiple commands (assuming paths don't contain newlines):
find . -type f -print | while IFS= read -r f; do
stat -c $n "$f";
stat -c %y "$f";
done
If toybox can't do multiple exec
, there are alternatives.
In this particular case, you may be able to just use a single stat:
find . -type f -exec stat -c "$(echo -e "%nn%y")" ;
# or just insert the newline verbatim in single quotes:
find . -type f -exec stat -c '%n
%y' ;
For running multiple commands (assuming paths don't contain newlines):
find . -type f -print | while IFS= read -r f; do
stat -c $n "$f";
stat -c %y "$f";
done
edited Mar 26 at 15:43
answered Mar 26 at 1:40
jhncjhnc
3,1922 silver badges17 bronze badges
3,1922 silver badges17 bronze badges
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
add a comment |
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
Wow perfect! The first command did it! I tried to do it with a single stat command as well but couldn't figure out how to escape newline. I wanted to put that into the "-c <format>" part, which didn't work. Your code snippet does it! Thx so much!
– TJJ
Mar 26 at 15:32
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
13 extra characters just to enter one newline :-) You could also just use single quotes and enter them verbatim.
– jhnc
Mar 26 at 15:42
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
I found that newline doesn't work with single quotes.
– TJJ
Mar 26 at 15:47
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
interesting. I guess your shell doesn't follow POSIX then (pubs.opengroup.org/onlinepubs/009695399/utilities/… - section 2.2.2)
– jhnc
Mar 26 at 15:57
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343812%2ffind-combining-multiple-exec-statements-not-working-with-toybox-android%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I think it's a bug in toybox as it doesn't work with the newest binary, though it runs with busybox.
– TJJ
Mar 25 at 18:43
It definitely is a bug. I reported it and it got already fixed. Unfortunately, this won't help me on Android until this version of toybox makes it into the firmware.
– TJJ
Mar 26 at 15:29