![]() + passes as many results as possible to each copy of bash. # works correctly with names echo doesn't handle - ones containing spaces, backslashes, etc It's saner to keep the logic in your parent shell, rather than shuffling it off to a subprocess: #!/usr/bin/env bash I am totally open to other approaches, especially if there's a more efficient way to do this. ![]() The above line, if it worked, would go in a loop running for each app to be removed with a list of app names in a variable. Is probably better than grep to extract the package name, but don't think that is why the above isn't working (no output from the test "echo rm" at all, and inserting a tee command to output to a file didn't do anything either). ![]() This is what I have for find -exec that isn't quite working find /Applications -maxdepth 3 -type f -name ist -exec sh -c "grep 'Example' | xargs dirname | xargs echo rm -" 2>/dev/nullÄefaults read $dir/Contents/Info CFBundleExecutable I've been playing around with find -exec, but am open to other approaches. IF the current folder has a subfolder named Contents that contains a file called ist that contains certain text, delete the current folder.Those directories have a Contents sub-directory that contains an ist that can be used to identify the app.Applications are just directories in OS X. ![]() I'm trying to create a script that will remove a list of applications in OS X.
0 Comments
Leave a Reply. |