[Edify question]-how to pipe

Search This thread

vinconti

Senior Member
Feb 21, 2007
93
5
I am trying to get my android updater-script to selectively change permissions based on filename. I want all files under a certain subdirectory following the naming pattern "A.xy" set to 0755 and all other files set to 0644

So I first set all of them to 0644, then tried to selectively set the rest to 0755 by piping commands using xargs and exec. However, neither of the following commands worked but neither of them gave an error. Does anyone have a better way of doing this, or have an idea why neither of these worked?

run_program("/sbin/busybox", "find", " /data/app", "-name", "A.xy", "-type", "f", "-print0", "|", "/sbin/busybox", "xargs", "-0", "chmod", "0644");

run_program("/sbin/busybox find /data/app -name A.xy -type f -exec chmod 0644 {} \;");

It seems like update-binary doesn't allow piping? It doesn't give an error though.

Any idea how I can set all files of one type to be one permission, and all files of another type to be a different permission?
 

Lawlrus

Senior Member
Nov 20, 2013
10,692
6,598
sorry it seemed more dev than QA but if I was mistaken, I apologize. What is the correct section?

Questions go in the Q&A section.
 

Attachments

  • Screenshot_20161130-013915.png
    Screenshot_20161130-013915.png
    147.2 KB · Views: 185

Top Liked Posts

Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone