﻿{"id":886,"date":"2014-04-27T11:22:46","date_gmt":"2014-04-27T03:22:46","guid":{"rendered":"http:\/\/notes.zerobox.org\/?p=886"},"modified":"2014-04-27T11:22:46","modified_gmt":"2014-04-27T03:22:46","slug":"bash%e8%84%9a%e6%9c%ac15%e5%88%86%e9%92%9f%e8%bf%9b%e9%98%b6%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/zerobox.org\/notes\/886.html","title":{"rendered":"Bash\u811a\u672c15\u5206\u949f\u8fdb\u9636\u6559\u7a0b"},"content":{"rendered":"<p>\u539f\u6587\u51fa\u5904\uff1a robertmuth   <\/p>\n<p>\u8fd9\u91cc\u7684\u6280\u672f\u6280\u5de7\u6700\u521d\u662f\u6765\u81ea\u8c37\u6b4c\u7684\u201cTesting on the Toilet\u201d (TOTT)\u3002\u8fd9\u91cc\u662f\u4e00\u4e2a\u4fee\u8ba2\u548c\u6269\u589e\u7248\u672c\u3002<\/p>\n<p>\u811a\u672c\u5b89\u5168<\/p>\n<p>\u6211\u7684\u6240\u6709bash\u811a\u672c\u90fd\u4ee5\u4e0b\u9762\u51e0\u53e5\u4e3a\u5f00\u573a\u767d\uff1a<\/p>\n<p>#!\/bin\/bash<br \/>\nset -o nounset<br \/>\nset -o errexit<br \/>\n\u8fd9\u6837\u505a\u4f1a\u907f\u514d\u4e24\u79cd\u5e38\u89c1\u7684\u95ee\u9898\uff1a<\/p>\n<p>\u5f15\u7528\u672a\u5b9a\u4e49\u7684\u53d8\u91cf(\u7f3a\u7701\u503c\u4e3a\u201c\u201d)<br \/>\n\u6267\u884c\u5931\u8d25\u7684\u547d\u4ee4\u88ab\u5ffd\u7565<br \/>\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6709\u4e9bLinux\u547d\u4ee4\u7684\u67d0\u4e9b\u53c2\u6570\u53ef\u4ee5\u5f3a\u5236\u5ffd\u7565\u53d1\u751f\u7684\u9519\u8bef\uff0c\u4f8b\u5982\u201cmkdir -p\u201d \u548c \u201crm -f\u201d\u3002<\/p>\n<p>\u8fd8\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u201cerrexit\u201d\u6a21\u5f0f\u4e0b\uff0c\u867d\u7136\u80fd\u6709\u6548\u7684\u6355\u6349\u9519\u8bef\uff0c\u4f46\u5e76\u4e0d\u80fd\u6355\u6349\u5168\u90e8\u5931\u8d25\u7684\u547d\u4ee4\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4e00\u4e9b\u5931\u8d25\u7684\u547d\u4ee4\u662f\u65e0\u6cd5\u68c0\u6d4b\u5230\u7684\u3002(\u66f4\u591a\u7ec6\u8282\u8bf7\u53c2\u8003\u8fd9\u4e2a\u5e16\u5b50\u3002)<\/p>\n<p>\u811a\u672c\u51fd\u6570<\/p>\n<p>\u5728bash\u91cc\u4f60\u53ef\u4ee5\u5b9a\u4e49\u51fd\u6570\uff0c\u5b83\u4eec\u5c31\u8ddf\u5176\u5b83\u547d\u4ee4\u4e00\u6837\uff0c\u53ef\u4ee5\u968f\u610f\u7684\u4f7f\u7528\uff1b\u5b83\u4eec\u80fd\u8ba9\u4f60\u7684\u811a\u672c\u66f4\u5177\u53ef\u8bfb\u6027\uff1a<\/p>\n<p>ExtractBashComments() {<br \/>\n    egrep &#8220;^#&#8221;<br \/>\n} <\/p>\n<p>cat myscript.sh | ExtractBashComments | wc<\/p>\n<p>comments=$(ExtractBashComments < myscript.sh)\n\u8fd8\u6709\u4e00\u4e9b\u4f8b\u5b50\uff1a\n\n\nSumLines() {  # iterating over stdin - similar to awk      \n    local sum=0\n    local line=\u201d\u201d\n    while read line ; do\n        sum=$((${sum} + ${line}))\n    done\n    echo ${sum}\n} \n \nSumLines < data_one_number_per_line.txt \n \nlog() {  # classic logger\n   local prefix=\"[$(date +%Y\/%m\/%d\\ %H:%M:%S)]: \"\n   echo \"${prefix} $@\" >&#038;2<br \/>\n} <\/p>\n<p>log &#8220;INFO&#8221; &#8220;a message&#8221;<br \/>\n\u5c3d\u53ef\u80fd\u7684\u628a\u4f60\u7684bash\u4ee3\u7801\u79fb\u5165\u5230\u51fd\u6570\u91cc\uff0c\u4ec5\u628a\u5168\u5c40\u53d8\u91cf\u3001\u5e38\u91cf\u548c\u5bf9\u201cmain\u201d\u8c03\u7528\u7684\u8bed\u53e5\u653e\u5728\u6700\u5916\u5c42\u3002<\/p>\n<p>\u53d8\u91cf\u6ce8\u89e3<\/p>\n<p>Bash\u91cc\u53ef\u4ee5\u5bf9\u53d8\u91cf\u8fdb\u884c\u6709\u9650\u7684\u6ce8\u89e3\u3002\u6700\u91cd\u8981\u7684\u4e24\u4e2a\u6ce8\u89e3\u662f\uff1a<\/p>\n<p>local(\u51fd\u6570\u5185\u90e8\u53d8\u91cf)<br \/>\nreadonly(\u53ea\u8bfb\u53d8\u91cf)<\/p>\n<p># a useful idiom: DEFAULT_VAL can be overwritten<br \/>\n#       with an environment variable of the same name<br \/>\nreadonly DEFAULT_VAL=${DEFAULT_VAL:-7} <\/p>\n<p>myfunc() {<br \/>\n   # initialize a local variable with the global default<br \/>\n   local some_var=${DEFAULT_VAL}<br \/>\n   &#8230;<br \/>\n}<br \/>\n\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u5c06\u4e00\u4e2a\u4ee5\u524d\u4e0d\u662f\u53ea\u8bfb\u53d8\u91cf\u7684\u53d8\u91cf\u58f0\u660e\u6210\u53ea\u8bfb\u53d8\u91cf\uff1a<\/p>\n<p>x=5<br \/>\nx=6<br \/>\nreadonly x<br \/>\nx=7   # failure<br \/>\n\u5c3d\u91cf\u5bf9\u4f60bash\u811a\u672c\u91cc\u7684\u6240\u6709\u53d8\u91cf\u4f7f\u7528local\u6216readonly\u8fdb\u884c\u6ce8\u89e3\u3002<\/p>\n<p>\u7528$()\u4ee3\u66ff\u53cd\u5355\u5f15\u53f7(`)<\/p>\n<p>\u53cd\u5355\u5f15\u53f7\u5f88\u96be\u770b\uff0c\u5728\u6709\u4e9b\u5b57\u4f53\u91cc\u8ddf\u6b63\u5355\u5f15\u53f7\u5f88\u76f8\u4f3c\u3002$()\u80fd\u591f\u5185\u5d4c\u4f7f\u7528\uff0c\u800c\u4e14\u907f\u514d\u4e86\u8f6c\u4e49\u7b26\u7684\u9ebb\u70e6\u3002<\/p>\n<p># both commands below print out: A-B-C-D<br \/>\necho &#8220;A-`echo B-\\`echo C-\\\\\\`echo D\\\\\\`\\&#8220;&#8221;<br \/>\necho &#8220;A-$(echo B-$(echo C-$(echo D)))&#8221;<br \/>\n\u7528[[]](\u53cc\u5c42\u4e2d\u62ec\u53f7)\u66ff\u4ee3[]<\/p>\n<p>\u4f7f\u7528[[]]\u80fd\u907f\u514d\u50cf\u5f02\u5e38\u7684\u6587\u4ef6\u6269\u5c55\u540d\u4e4b\u7c7b\u7684\u95ee\u9898\uff0c\u800c\u4e14\u80fd\u5e26\u6765\u5f88\u591a\u8bed\u6cd5\u4e0a\u7684\u6539\u8fdb\uff0c\u800c\u4e14\u8fd8\u589e\u52a0\u4e86\u5f88\u591a\u65b0\u529f\u80fd\uff1a<\/p>\n<p>\u64cd\u4f5c\u7b26\t\u529f\u80fd\u8bf4\u660e<br \/>\n||\t\u903b\u8f91or(\u4ec5\u53cc\u4e2d\u62ec\u53f7\u91cc\u4f7f\u7528)<br \/>\n&#038;&#038;\t\u903b\u8f91and(\u4ec5\u53cc\u4e2d\u62ec\u53f7\u91cc\u4f7f\u7528)<br \/>\n<\t\u5b57\u7b26\u4e32\u6bd4\u8f83(\u53cc\u4e2d\u62ec\u53f7\u91cc\u4e0d\u9700\u8981\u8f6c\u79fb)\n-lt\t\u6570\u5b57\u6bd4\u8f83\n=\t\u5b57\u7b26\u4e32\u76f8\u7b49\n==\t\u4ee5Globbing\u65b9\u5f0f\u8fdb\u884c\u5b57\u7b26\u4e32\u6bd4\u8f83(\u4ec5\u53cc\u4e2d\u62ec\u53f7\u91cc\u4f7f\u7528\uff0c\u53c2\u8003\u4e0b\u6587)\n=~\t\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u5b57\u7b26\u4e32\u6bd4\u8f83(\u4ec5\u53cc\u4e2d\u62ec\u53f7\u91cc\u4f7f\u7528\uff0c\u53c2\u8003\u4e0b\u6587)\n-n\t\u975e\u7a7a\u5b57\u7b26\u4e32\n-z\t\u7a7a\u5b57\u7b26\u4e32\n-eq\t\u6570\u5b57\u76f8\u7b49\n-ne\t\u6570\u5b57\u4e0d\u7b49\n\u5355\u4e2d\u62ec\u53f7\uff1a\n\n[ \"${name}\" \\> &#8220;a&#8221; -o ${name} \\< \"m\" ]\n\u53cc\u4e2d\u62ec\u53f7\n\n[[ \"${name}\" > &#8220;a&#8221; &#038;&#038; &#8220;${name}&#8221; < \"m\"  ]]\n\u6b63\u5219\u8868\u8fbe\u5f0f\/Globbing\n\n\u4f7f\u7528\u53cc\u4e2d\u62ec\u53f7\u5e26\u6765\u7684\u597d\u5904\u7528\u4e0b\u9762\u51e0\u4e2a\u4f8b\u5b50\u6700\u80fd\u8868\u73b0\uff1a\n\nt=\"abc123\"\n[[ \"$t\" == abc* ]]         # true (globbing\u6bd4\u8f83)\n[[ \"$t\" == \"abc*\" ]]       # false (\u5b57\u9762\u6bd4\u8f83)\n[[ \"$t\" =~ [abc]+[123]+ ]] # true (\u6b63\u5219\u8868\u8fbe\u5f0f\u6bd4\u8f83)\n[[ \"$t\" =~ \"abc*\" ]]       # false (\u5b57\u9762\u6bd4\u8f83)\n\u6ce8\u610f\uff0c\u4ecebash 3.2\u7248\u5f00\u59cb\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u548cglobbing\u8868\u8fbe\u5f0f\u90fd\u4e0d\u80fd\u7528\u5f15\u53f7\u5305\u88f9\u3002\u5982\u679c\u4f60\u7684\u8868\u8fbe\u5f0f\u91cc\u6709\u7a7a\u683c\uff0c\u4f60\u53ef\u4ee5\u628a\u5b83\u5b58\u50a8\u5230\u4e00\u4e2a\u53d8\u91cf\u91cc\uff1a\n\nr=\"a b+\"\n[[ \"a bbb\" =~ $r ]]        # true\n\u6309Globbing\u65b9\u5f0f\u7684\u5b57\u7b26\u4e32\u6bd4\u8f83\u4e5f\u53ef\u4ee5\u7528\u5230case\u8bed\u53e5\u4e2d\uff1a\n\ncase $t in\nabc*)  <action> ;;<br \/>\nesac<br \/>\n\u5b57\u7b26\u4e32\u64cd\u4f5c<\/p>\n<p>Bash\u91cc\u6709\u5404\u79cd\u5404\u6837\u64cd\u4f5c\u5b57\u7b26\u4e32\u7684\u65b9\u5f0f\uff0c\u5f88\u591a\u90fd\u662f\u4e0d\u53ef\u53d6\u7684\u3002<\/p>\n<p>\u57fa\u672c\u7528\u6237<\/p>\n<p>f=&#8221;path1\/path2\/file.ext&#8221; <\/p>\n<p>len=&#8221;${#f}&#8221; # = 20 (\u5b57\u7b26\u4e32\u957f\u5ea6) <\/p>\n<p># \u5207\u7247\u64cd\u4f5c: ${<var>:<start>} or ${<var>:<start>:<length>}<br \/>\nslice1=&#8221;${f:6}&#8221; # = &#8220;path2\/file.ext&#8221;<br \/>\nslice2=&#8221;${f:6:5}&#8221; # = &#8220;path2&#8243;<br \/>\nslice3=&#8221;${f: -8}&#8221; # = &#8220;file.ext&#8221;(\u6ce8\u610f\uff1a&#8221;-&#8220;\u524d\u6709\u7a7a\u683c)<br \/>\npos=6<br \/>\nlen=5<br \/>\nslice4=&#8221;${f:${pos}:${len}}&#8221; # = &#8220;path2&#8243;<br \/>\n\u66ff\u6362\u64cd\u4f5c(\u4f7f\u7528globbing)<\/p>\n<p>f=&#8221;path1\/path2\/file.ext&#8221; <\/p>\n<p>single_subst=&#8221;${f\/path?\/x}&#8221;   # = &#8220;x\/path2\/file.ext&#8221;<br \/>\nglobal_subst=&#8221;${f\/\/path?\/x}&#8221;  # = &#8220;x\/x\/file.ext&#8221; <\/p>\n<p># \u5b57\u7b26\u4e32\u62c6\u5206<br \/>\nreadonly DIR_SEP=&#8221;\/&#8221;<br \/>\narray=(${f\/\/${DIR_SEP}\/ })<br \/>\nsecond_dir=&#8221;${arrray[1]}&#8221;     # = path2<br \/>\n\u5220\u9664\u5934\u90e8\u6216\u5c3e\u90e8(\u4f7f\u7528globbing)<\/p>\n<p>f=&#8221;path1\/path2\/file.ext&#8221;<\/p>\n<p># \u5220\u9664\u5b57\u7b26\u4e32\u5934\u90e8<br \/>\nextension=&#8221;${f#*.}&#8221;  # = &#8220;ext&#8221;<\/p>\n<p># \u4ee5\u8d2a\u5a6a\u5339\u914d\u65b9\u5f0f\u5220\u9664\u5b57\u7b26\u4e32\u5934\u90e8<br \/>\nfilename=&#8221;${f##*\/}&#8221;  # = &#8220;file.ext&#8221;<\/p>\n<p># \u5220\u9664\u5b57\u7b26\u4e32\u5c3e\u90e8<br \/>\ndirname=&#8221;${f%\/*}&#8221;    # = &#8220;path1\/path2&#8243; <\/p>\n<p># \u4ee5\u8d2a\u5a6a\u5339\u914d\u65b9\u5f0f\u5220\u9664\u5b57\u7b26\u4e32\u5c3e\u90e8<br \/>\nroot=&#8221;${f%%\/*}&#8221;      # = &#8220;path1&#8221;<br \/>\n\u907f\u514d\u4f7f\u7528\u4e34\u65f6\u6587\u4ef6<\/p>\n<p>\u6709\u4e9b\u547d\u4ee4\u9700\u8981\u4ee5\u6587\u4ef6\u540d\u4e3a\u53c2\u6570\uff0c\u8fd9\u6837\u4e00\u6765\u5c31\u4e0d\u80fd\u4f7f\u7528\u7ba1\u9053\u3002\u8fd9\u4e2a\u65f6\u5019?<()?\u5c31\u663e\u51fa\u7528\u5904\u4e86\uff0c\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u547d\u4ee4\uff0c\u5e76\u628a\u5b83\u8f6c\u6362\u6210\u53ef\u4ee5\u5f53\u6210\u6587\u4ef6\u540d\u4e4b\u7c7b\u7684\u4ec0\u4e48\u4e1c\u897f\uff1a\n\n\n# \u4e0b\u8f7d\u5e76\u6bd4\u8f83\u4e24\u4e2a\u7f51\u9875\ndiff <(wget -O - url1) <(wget -O - url2)\n\u8fd8\u6709\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u5904\u7684\u662f\u201dhere documents\u201d\uff0c\u5b83\u80fd\u8ba9\u4f60\u5728\u6807\u51c6\u8f93\u5165\u4e0a\u8f93\u5165\u591a\u884c\u5b57\u7b26\u4e32\u3002\u4e0b\u9762\u7684\u2019MARKER\u2019\u53ef\u4ee5\u66ff\u6362\u6210\u4efb\u4f55\u5b57\u8bcd\u3002\n\n\n# \u4efb\u4f55\u5b57\u8bcd\u90fd\u53ef\u4ee5\u5f53\u4f5c\u5206\u754c\u7b26\ncommand  << MARKER\n...\n${var}\n$(cmd)\n...\nMARKER\n\u5982\u679c\u6587\u672c\u91cc\u6ca1\u6709\u5185\u5d4c\u53d8\u91cf\u66ff\u6362\u64cd\u4f5c\uff0c\u4f60\u53ef\u4ee5\u628a\u7b2c\u4e00\u4e2aMARKER\u7528\u5355\u5f15\u53f7\u5305\u8d77\u6765\uff1a\n\n\ncommand << 'MARKER'\n...\nno substitution is happening here.\n$ (dollar sign) is passed through verbatim.\n...\nMARKER\n\u5185\u7f6e\u53d8\u91cf\n\n\u53d8\u91cf\t\u8bf4\u660e\n$0\t\u811a\u672c\u540d\u79f0\n$n\t\u4f20\u7ed9\u811a\u672c\/\u51fd\u6570\u7684\u7b2cn\u4e2a\u53c2\u6570\n$$\t\u811a\u672c\u7684PID\n$!\t\u4e0a\u4e00\u4e2a\u88ab\u6267\u884c\u7684\u547d\u4ee4\u7684PID(\u540e\u53f0\u8fd0\u884c\u7684\u8fdb\u7a0b)\n$?\t\u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684\u9000\u51fa\u72b6\u6001(\u7ba1\u9053\u547d\u4ee4\u4f7f\u7528${PIPESTATUS})\n$#\t\u4f20\u9012\u7ed9\u811a\u672c\/\u51fd\u6570\u7684\u53c2\u6570\u4e2a\u6570\n$@\t\u4f20\u9012\u7ed9\u811a\u672c\/\u51fd\u6570\u7684\u6240\u6709\u53c2\u6570(\u8bc6\u522b\u6bcf\u4e2a\u53c2\u6570)\n$*\t\u4f20\u9012\u7ed9\u811a\u672c\/\u51fd\u6570\u7684\u6240\u6709\u53c2\u6570(\u628a\u6240\u6709\u53c2\u6570\u5f53\u6210\u4e00\u4e2a\u5b57\u7b26\u4e32)\n\u63d0\u793a\n\u4f7f\u7528$*\u5f88\u5c11\u662f\u6b63\u786e\u7684\u9009\u62e9\u3002\n$@\u80fd\u591f\u5904\u7406\u7a7a\u683c\u53c2\u6570\uff0c\u800c\u4e14\u53c2\u6570\u95f4\u7684\u7a7a\u683c\u4e5f\u80fd\u6b63\u786e\u7684\u5904\u7406\u3002\n\u4f7f\u7528$@\u65f6\u5e94\u8be5\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\u6765\uff0c\u50cf\u201d$@\u201d\u8fd9\u6837\u3002\n\u8c03\u8bd5\n\n\u5bf9\u811a\u672c\u8fdb\u884c\u8bed\u6cd5\u68c0\u67e5\uff1a\n\n\nbash -n myscript.sh\n\u8ddf\u8e2a\u811a\u672c\u91cc\u6bcf\u4e2a\u547d\u4ee4\u7684\u6267\u884c\uff1a\n\n\nbash -v myscripts.sh\n\u8ddf\u8e2a\u811a\u672c\u91cc\u6bcf\u4e2a\u547d\u4ee4\u7684\u6267\u884c\u5e76\u9644\u52a0\u6269\u5145\u4fe1\u606f\uff1a\n\n\nbash -x myscript.sh\n\u4f60\u53ef\u4ee5\u5728\u811a\u672c\u5934\u90e8\u4f7f\u7528set -o verbose\u548cset -o xtrace\u6765\u6c38\u4e45\u6307\u5b9a-v\u548c-o\u3002\u5f53\u5728\u8fdc\u7a0b\u673a\u5668\u4e0a\u6267\u884c\u811a\u672c\u65f6\uff0c\u8fd9\u6837\u505a\u975e\u5e38\u6709\u7528\uff0c\u7528\u5b83\u6765\u8f93\u51fa\u8fdc\u7a0b\u4fe1\u606f\u3002\n\n\u4ec0\u4e48\u65f6\u5019\u4e0d\u5e94\u8be5\u4f7f\u7528bash\u811a\u672c\n\n\u4f60\u7684\u811a\u672c\u592a\u957f\uff0c\u591a\u8fbe\u51e0\u767e\u884c\n\u4f60\u9700\u8981\u6bd4\u6570\u7ec4\u66f4\u590d\u6742\u7684\u6570\u636e\u7ed3\u6784\n\u51fa\u73b0\u4e86\u590d\u6742\u7684\u8f6c\u4e49\u95ee\u9898\n\u6709\u592a\u591a\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\n\u4e0d\u592a\u9700\u8981\u8c03\u7528\u5176\u5b83\u7a0b\u5e8f\u548c\u8ddf\u5176\u5b83\u7a0b\u5e8f\u7ba1\u9053\u4ea4\u4e92\n\u62c5\u5fc3\u6027\u80fd\n\u8fd9\u4e2a\u65f6\u5019\uff0c\u4f60\u5e94\u8be5\u8003\u8651\u4e00\u79cd\u811a\u672c\u8bed\u8a00\uff0c\u6bd4\u5982Python\u6216Ruby\u3002\n\n\u53c2\u8003\n\nAdvanced Bash-Scripting Guide:?http:\/\/tldp.org\/LDP\/abs\/html\/\nBash Reference Manual\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u51fa\u5904\uff1a robertmuth \u8fd9\u91cc\u7684\u6280\u672f\u6280\u5de7\u6700\u521d\u662f\u6765\u81ea\u8c37\u6b4c\u7684\u201cTesting &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/zerobox.org\/notes\/886.html\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[224],"class_list":["post-886","post","type-post","status-publish","format-standard","hentry","tag-bash"],"views":452,"_links":{"self":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/comments?post=886"}],"version-history":[{"count":0,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/886\/revisions"}],"wp:attachment":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media?parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/categories?post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/tags?post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}