Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. {"hash": "79e7b189ab3985f4bf753ba706da07ed", "thumb_exists": false, "bytes": 0, "path": "/", "is_dir": true, "size": "0 bytes", "root": "app_folder", "contents": [{"revision": 135, "rev": "8714372dc4", "thumb_exists": false, "bytes": 0, "modified": "Fri, 25 Oct 2013 00:05:18 +0000", "path": "/home", "is_dir": true, "icon": "folder", "root": "dropbox", "size": "0 bytes"}, {"revision": 1, "rev": "114372dc4", "thumb_exists": false, "bytes": 1223, "modified": "Mon, 16 Sep 2013 21:00:23 +0000", "client_mtime": "Mon, 16 Sep 2013 21:00:23 +0000", "path": "/serial.c", "is_dir": false, "icon": "page_white_code", "root": "dropbox", "mime_type": "text/x-csrc", "size": "1.2 KB"}], "icon": "folder"}
  2.  
  3. echo "$DIR_CONTENT" | sed 's/\"/\u0022/' | sed -n 's/.*"bytes": *([0-9]*),.*"path": *"([^"]*)",.*"is_dir": *([^"]*),.*/2:3;1/p'
  4.  
  5. /home:true;0
  6. /serial.c:false;1223
  7.  
  8. /home:true;0;Fri, 25 Oct 2013 00:05:18 +0000
  9. /serial.c:false;1223;Mon, 16 Sep 2013 21:00:23 +0000
  10.  
  11. $ echo "$DIR_CONTENT" | sed 's/\"/\u0022/' | sed -n 's/.*"bytes": *([0-9]*),.*"modified": *"([^"]*).*"path": *"([^"]*)",.*"is_dir": *([^"]*),.*/3:4;1;2/p'
  12. /serial.c:false;1223;Mon, 16 Sep 2013 21:00:23 +0000
  13.  
  14. echo "$DIR_CONTENT" | sed 's/\"/\u0022/' | sed -n 's/.*"bytes": *([0-9]*),.*"modified"([^"]*)",.*"path": *"([^"]*)",.*"is_dir": *([^"]*),.*/3:4;1;2/p'
  15.  
  16. echo "$DIR_CONTENT" | sed -nr '
  17. s#.*"contents": [([^]]*)].*#1#
  18. :X
  19. h
  20. s#({[^}]*}).*#1#
  21. s#"([^"]*)": ("?[^"]*"?),#1a2n#g
  22. s#.*bytesa([^n]*).*modifieda([^n]*).*patha([^n]*).*is_dira([^n]*).*#3:4;1;2#
  23. s#"##gp
  24. g
  25. /({[^}]*}), (.*)/{ s##2#; bX }
  26. '
  27. /home:true;0;Fri, 25 Oct 2013 00:05:18 +0000
  28. /serial.c:false;1223;Mon, 16 Sep 2013 21:00:23 +0000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement