Guest User

Untitled

a guest
Jul 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # For logging file system writes to file
  2. trace(){
  3. if [ ! -z "$1" ] && [ ! -z "$2" ]; then
  4. sandbox-exec -p "(version 1) (allow default) (deny file-write*) (trace \"$2\")" "$1"
  5. else
  6. echo "";
  7. echo "Executes a program or script in a sandbox that logs all file system writes. ";
  8. echo "";
  9. echo "trace <program> <logfile>";
  10. echo "";
  11. echo -en "\033[1m Ex.:\t\033[0m";
  12. echo "trace /Applications/TextEdit.app/Contents/MacOS/TextEdit ~/textedit_trace.sb";
  13. echo -e " Starts TextEdit and logs its file writes to ~/textedit_trace.sb";
  14. echo "";
  15. fi
  16. }
Add Comment
Please, Sign In to add comment