{"id":806,"date":"2010-07-16T22:58:18","date_gmt":"2010-07-17T04:58:18","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=806"},"modified":"2010-07-17T02:15:26","modified_gmt":"2010-07-17T08:15:26","slug":"my_shell-c%e4%bb%a3%e7%a0%81%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/806","title":{"rendered":"my_shell.c\u4ee3\u7801\u5206\u6790"},"content":{"rendered":"<p>\u5927\u4e09\u7684\u65f6\u5019\uff0c\u90a3\u65f6\u5019\u56e0\u4e3a\u8bfe\u7a0b\u9700\u8981\uff0c\u6211\u4eec\u8c03\u8bd5\u8fc7my_shell.c\u7a0b\u5e8f\u3002\u5f53\u65f6\u53ea\u662f\u5bf9\u6574\u4e2a\u7a0b\u5e8f\u7684\u7ed3\u6784\u4e86\u89e3\uff0c\u5728\u6d89\u53calinux\u7cfb\u7edf\u8c03\u7528\u51fd\u6570\u7684\u65f6\u5019\u5c31\u4e0d\u662f\u5f88\u6e05\u695a&#8221;\u4e3a\u4ec0\u4e48\u4f1a\u8fd9\u6837\u505a\uff1f&#8221;\u3002my_shell.c\u7a0b\u5e8f\u6838\u5fc3\u51fd\u6570\u4fbf\u662fdo_cmd\u51fd\u6570\uff0c\u6b64\u51fd\u6570\u662f\u6574\u4e2a\u7a0b\u5e8f\u7684\u6838\u5fc3\uff0c\u8d1f\u8d23\u5bf9\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4\u8fdb\u884c\u6267\u884c\u3002<\/p>\n<p>\u672c\u6587\u4fbf\u662f\u5206\u6790do_cmd\u51fd\u6570\uff0c\u4ee5\u8fbe\u5230\u5bf9my_shell.c\u7a0b\u5e8f\u6709\u6df1\u5165\u7684\u7406\u89e3\u3002\u6b64\u51fd\u6570\u4f1a\u6d89\u53ca\u6587\u4ef6\u64cd\u4f5c\u4e2d\u7684\u76f8\u5173\u7cfb\u7edf\u8c03\u7528\u51fd\u6570\uff0c\u5982\u679c\u4f60\u548c\u6211\u4e00\u6837\u8c03\u8bd5\u5e76\u5206\u6790\u8fc7\u524d\u9762\u6240\u8bf4\u7684my_ls.c\u7a0b\u5e8f\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u6240\u8ff0\u7684\u5185\u5bb9\u5bf9\u4f60\u6765\u8bf4\u5e76\u4e0d\u56f0\u96be\u3002<\/p>\n<p>\u6211\u4eec\u6309\u7167\u5982\u4e0b\u65b9\u5f0f\u5b9a\u4e49do_cmd\u51fd\u6570\uff1a<\/p>\n<pre class=\"brush:c\">void do_cmd(int argcount, char arglist[100][256]);<\/pre>\n<p>\u5176\u4e2d\uff0cargcount\u662f\u7edf\u8ba1\u7528\u6237\u8f93\u5165\u547d\u4ee4\u4e2d\u9009\u9879\u7684\u4e2a\u6570\uff0carglist\u6570\u7ec4\u5b58\u50a8\u6bcf\u4e2a\u9009\u9879\u3002\u6bd4\u5982\u8f93\u5165\uff1als -l \/\u90a3\u4e48\u6b64\u65f6argcount=3,\u800carglist[0],arglist[1],arglist[2]\u4e2d\u5206\u522b\u5b58\u50a8\u7684\u662f\uff1als,-l,\/\u3002<\/p>\n<p>\u9996\u5148\u6b64\u51fd\u6570\u4f1a\u68c0\u67e5\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4\u884c\u53c2\u6570\u4e2d\u662f\u5426\u5b58\u5728\u540e\u53f0\u8fd0\u884c\u7b26\u3002\u5229\u7528for\u5faa\u73af\uff0c\u5bf9arglist\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u53c2\u6570\u4e0e&#8221;&amp;&#8221;\u8fdb\u884c\u6bd4\u8f83\u3002\u7531\u4e8earglist\u4e2d\u7684\u5143\u7d20\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e48\u5e94\u8be5\u9009\u7528strcmp\u51fd\u6570\uff0c\u800c\u4e0d\u662f\u5229\u7528==\u6765\u5224\u65ad\u3002\u6b64\u5916\u5373\u4fbf\u627e\u5230\u4e86\u540e\u53f0\u8fd0\u884c\u7b26\uff0c\u8fd8\u5e94\u8be5\u68c0\u67e5\u662f\u5426&#8221;&amp;&#8221;\u4f4d\u4e8e\u53c2\u6570\u672b\u5c3e\u3002\u5982\u679ci==argcount-1\u4e3a\u5047\uff0c\u90a3\u4e48\u4fbf\u51fa\u9519\u3002\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre class=\"brush:c\">\/\/check if the command include character of running in the background\r\n\tfor(i=0;i&lt;\\argcount;i++)\r\n\t{\r\n\t\tif(strncmp(arg[i],\"&amp;\",1)==0)\r\n\t\t{\r\n\t\t\tif(i==argcount-1)\r\n\t\t\t{\r\n\t\t\t\tbackground=1;\r\n\t\t\t\targ[argcount-1]=NULL;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tprintf(\"wrong command\\n\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}\/\/for<\/pre>\n<p>\u63a5\u4e0b\u6765\uff0c\u68c0\u6d4b\u547d\u4ee4\u884c\u53c2\u6570\u662f\u5426\u542b\u6709&gt;,&lt;,|\u7b26\u53f7\uff0c\u68c0\u6d4b\u65b9\u6cd5\u4e0e\u4e0a\u51fa\u4ee3\u7801\u539f\u7406\u7c7b\u4f3c\u3002\u7531\u4e8e\u672c\u7a0b\u5e8f\u8981\u6c42\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4\u884c\u53c2\u6570\u53ea\u80fd\u5305\u542b\u4e0a\u8ff0\u7b26\u53f7\u5176\u4e2d\u4e4b\u4e00\uff0c\u6240\u4ee5\u5f53flag\u5927\u4e8e\u4e00\u65f6\uff0c\u9519\u8bef\u3002\u53c2\u6570\u4e2d\u7b26\u53f7\u5408\u6cd5\uff0c\u63a5\u4e0b\u6765\u63d0\u53d6\u6587\u4ef6\u540d\uff0c\u5b58\u4e8e\u5b57\u7b26\u4e32file\u4e2d\u3002\u7a0b\u5e8f\u4e2d\u5206\u522b\u6709\u4e09\u4e2aif\u8bed\u53e5\u4f9d\u6b21\u9488\u5bf9\u51fa\u73b0&gt;,&lt;,|\u65f6\u7684\u60c5\u51b5\u3002\u6211\u4eec\u53ea\u8981\u5206\u6790\u51fa\u73b0\u7ba1\u9053\u7b26\u53f7\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u5728\u5206\u6790\u4e4b\u524d\u9996\u5148\u5f04\u8d77\u51fa\u7ba1\u9053\u7b26\u53f7\u7684\u4f5c\u7528\u3002\u6bd4\u5982\u4e0b\u9762\u547d\u4ee4\uff1a<\/p>\n<pre class=\"brush:c\">edsionte@edsionte-laptop:~$ ls -l \/ | wc -c\r\n1513<\/pre>\n<p>\u7ba1\u9053\u7b26\u53f7\u524d\u540e\u5206\u522b\u662f\u4e24\u4e2ashell\u547d\u4ee4\uff0c\u524d\u547d\u4ee4\u7684\u8f93\u51fa\u4f5c\u4e3a\u540e\u547d\u4ee4\u7684\u8f93\u5165\u3002<\/p>\n<p>\u5982\u679c\u68c0\u6d4b\u51fa\u547d\u4ee4\u884c\u4e2d\u542b\u6709\u7ba1\u9053\u7b26\u53f7\uff0c\u5373how=have_pipe\u3002\u7136\u540e\u5c06\u547d\u4ee4\u884c\u4e2d\u4e24\u4e2ashell\u547d\u4ee4\u5206\u79bb\u51fa\u6765\uff0c\u524d\u547d\u4ee4\u4f9d\u7136\u5b58\u4e8earg\u6570\u7ec4\u4e2d\uff0c\u800c\u540e\u547d\u4ee4\u5b58\u4e8eargnext\u6570\u7ec4\u4e2d\u3002\u5b9e\u73b0\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">if(how==have_pipe)\r\n\t{\r\n\t\tfor(i=0;arg[i]!=NULL;i++)\r\n\t\t{\r\n\t\t\tif(strncmp(arg[i],\"|\",1)==0)\r\n\t\t\t{\r\n\t\t\t\targ[i]=NULL;\r\n\t\t\t\tint j;\r\n\t\t\t\tfor(j=i+1;arg[j]!=NULL;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\targnext[j-(i+1)]=arg[j];\r\n\t\t\t\t}\r\n\t\t\t\targnext[j-(i+1)]=arg[j];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}<\/pre>\n<p>\u63a5\u4e0b\u6765\u5c31\u8981\u7528\u5230\u8fdb\u7a0b\u63a7\u5236\u7684\u5185\u5bb9\u4e86\u3002\u6211\u4eecfork\u4e00\u4e2a\u65b0\u7684\u8fdb\u7a0b\uff0c\u8ba9\u5b83\u53bb\u6267\u884c\u547d\u4ee4\u884c\u53c2\u6570\u4e2d\u7684\u547d\u4ee4\u3002\u5f53\u547d\u4ee4\u884c\u4e2d\u4e0d\u5305\u542b\u7ba1\u9053\u7b26\u53f7\u65f6\uff0c\u53ea\u9700fork\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u6bd4\u5982ls -l \/ &gt; a;\u6211\u4eec\u53ea\u9700fork\u4e00\u4e2a\u65b0\u8fdb\u7a0b\uff0c\u8ba9\u5176\uff08if(pid==0)\uff09\u6267\u884cls\u547d\u4ee4\u5373\u53ef\uff1b\u5426\u5219\uff0c\u6211\u4eec\u5fc5\u987bfork\u4e24\u4e2a\u4fe1\u8fdb\u7a0b\uff0c\u524d\u4e00\u4e2a\u8fdb\u7a0b\u6267\u884c|\u524d\u7684\u547d\u4ee4\uff0c\u53e6\u5916\u4e00\u4e2a\u8fdb\u7a0b\u6267\u884c|\u540e\u7684\u547d\u4ee4\u3002\u81f3\u4e8e\u53e6\u4e2a\u8fdb\u7a0b\u5982\u4f55&#8221;\u901a\u4fe1&#8221;\uff0c\u5982\u4f55\u8ba9\u524d\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u79f0\u4e3a\u540e\u8005\u7684\u8f93\u5165\uff1f\u4e0d\u7740\u6025\uff0c\u540e\u9762\u4f1a\u8be6\u7ec6\u8bf4\u660e\u3002<\/p>\n<p>1.\u5982\u679c\u6240\u8f93\u547d\u4ee4\u4e2d\u4e0d\u5305\u542b&lt;,&gt;,|\uff0chow==normal(0);\u90a3\u4e48\u8c03\u7528exe\u65cf\u51fd\u6570\u5373\u53ef\u8ba9\u5b50\u8fdb\u7a0b\u53bb\u6267\u884c\u6240\u8f93\u7684\u547d\u4ee4\u3002\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\t\t\tif(pid==0)\r\n\t\t\t{\r\n\t\t\t\tif(!(find_command(arg[0])))\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"%s: command not found\\n\",arg[0]);\r\n\t\t\t\t\texit(0);\r\n\t\t\t\t}\r\n\t\t\t\texecvp(arg[0],arg);\r\n\t\t\t\texit(0);\r\n\t\t\t}<\/pre>\n<p>find_command\u51fd\u6570\u662f\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u53bb\u67e5\u627e\u547d\u4ee4arg[0]\u5bf9\u5e94\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n<p>2.\u5982\u679c\u547d\u4ee4\u884c\u4e2d\u5305\u62ec\u8f93\u51fa\u91cd\u5b9a\u5411\u7b26\u53f7&gt;\uff0chow==out_redirect(1);\u90a3\u4e48\u9700\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2dexe\u51fd\u6570\u524d\u6dfb\u52a0\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<pre class=\"brush:c\">\t\t\t\tfd=open(file,O_RDWR|O_CREAT|O_TRUNC,0644);\r\n\t\t\t\tdup2(fd,1);\/\/make the file as a standard output stream\r\n\t\t\t\texecvp(arg[0],arg);\/\/execute the command<\/pre>\n<p>\u524d\u9762\u6211\u4eec\u5df2\u7ecf\u63d0\u5230file\u4e2d\u5b58\u50a8\u7684\u662f\u8f93\u51fa\u91cd\u5b9a\u5411\uff08\u6216\u8f93\u5165\u91cd\u5b9a\u5411\uff09\u7684\u6587\u4ef6\u540d\uff0c\u56e0\u6b64\u9996\u5148\u5e94\u4ee5\u53ef\u8bfb\u53ef\u5199\u65b9\u5f0f\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u5e76\u4e14\u6863\u8981\u6253\u5f00\u7684\u6587\u4ef6\u5b58\u5728\u65f6\uff0c\u4f1a\u6e05\u7a7a\u6e90\u6587\u4ef6\u6570\u636e\uff0c\u8fd9\u4e9b\u6211\u4eec\u5728\u524d\u9762\u7684\u535a\u6587\u4e2d\u90fd\u6709\u89e3\u91ca\u3002\u6211\u4eec\u77e5\u9053\u6807\u51c6\u8f93\u51fa\u8f93\u5165\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e3a\uff1a1\uff0c0\uff0c\u5229\u7528dup2\u51fd\u6570\u5c31\u53ef\u4ee5\u5c06fd\uff0c1\u540c\u65f6\u6307\u5411file\u6587\u4ef6\uff0c\u5b9e\u73b0\u5c06\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6211\u4eec\u521a\u5df2\u6253\u5f00\u7684\u6587\u4ef6\u3002<\/p>\n<p>3.\u5982\u679c\u547d\u4ee4\u884c\u4e2d\u5305\u542b\u8f93\u5165\u91cd\u5b9a\u5411\u7b26\u53f7&lt;\uff0chow==out_redirect(2);\u90a3\u4e48\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre class=\"brush:c\">\t\t\t\tfd=open(file,O_RDONLY);\r\n\t\t\t\tdup2(fd,0);\/\/make the file as a standard output stream\r\n\t\t\t\texecvp(arg[0],arg);\/\/execute the command<\/pre>\n<p>\u8fd9\u91cc\u53ea\u6d89\u53ca\u5230\u8bfb\u53d6\u6587\u4ef6\uff0c\u56e0\u6b64\u4ee5\u53ea\u8bfb\u65b9\u5f0f\u6253\u5f00\u6587\u4ef6\u3002<\/p>\n<p>4.\u5982\u679c\u547d\u4ee4\u884c\u4e2d\u5305\u542b\u7ba1\u9053\u7b26\u53f7\uff0chow==have_pipe(3);\u5982\u540c\u6211\u4eec\u5728\u4e0a\u9762\u6240\u8ff0\u7684\uff0c\u5b50\u8fdb\u7a0b\u8fd8\u9700\u518dfork\u4e00\u4e2a\u8fdb\u7a0b\uff08\u6682\u4e14\u53eb\u5b83\u5b50\u5b50\u8fdb\u7a0b\uff0cchild_child_process\uff09\u3002\u9996\u5148\u8ba9\u5b50\u5b50\u8fdb\u7a0b\u53bb\u6267\u884c\u7ba1\u9053\u7b26\u53f7\u524d\u9762\u7684shell\u547d\u4ee4\uff0c\u5e76\u5c06\u8f93\u51fa\u7ed3\u679c\u6682\u5b58\u4e8etempfile\u6587\u4ef6\u4e2d\uff1b\u8ba9\u5b50\u8fdb\u7a0b\u53bb\u6267\u884c\u7ba1\u9053\u7b26\u53f7\u540e\u9762\u7684shell\u547d\u4ee4\uff0c\u5e76\u8bfb\u53d6tempfile\u6587\u4ef6\uff0c\u5c06\u5176\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u547d\u4ee4\u7684\u8f93\u5165\u3002\u8fd9\u6837\uff0c\u5b50\u8fdb\u7a0b\u548c\u5b50\u5b50\u8fdb\u7a0b\u5b9e\u73b0\u4e86\u7ba1\u9053&#8221;\u901a\u4fe1&#8221;\u3002\u5177\u4f53\u4ee3\u7801\u5b9e\u73b0\u5176\u5b9e\u662f\u4e0a\u8ff02\u548c3\u7684\u7ed3\u5408\uff0c\u5177\u4f53\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\t\t\tif(pid==0)\/\/child_process\r\n\t\t\t{\r\n\t\t\t\tint pid2;\r\n\t\t\t\tint status2;\r\n\t\t\t\tint fd2;\r\n\r\n\t\t\t\tif((pid2=fork())&lt;\\0)\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"fork2 error\\n\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pid2==0)\/\/child_child_process\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!(find_command(arg[0])))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tprintf(\"%s: command not found\\n\",arg[0]);\r\n\t\t\t\t\t\texit(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfd2=open(\"\/tmp\/tempfile\",O_WRONLY|O_CREAT|O_TRUNC,0644);\r\n\t\t\t\t\tdup2(fd2,1);\r\n\t\t\t\t\texecvp(arg[0],arg);\r\n\t\t\t\t\texit(0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(waitpid(pid2,&amp;status2,0)==-1)\/\/waiting for child_child_process\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"wait for child_child process error\\n\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(find_command(argnext[0])))\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"%s:command not found\\n\",argnext[0]);\r\n\t\t\t\t\texit(0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfd2=open(\"\/tmp\/tempfile\",O_RDONLY);\r\n\t\t\t\tdup2(fd2,0);\r\n\t\t\t\texecvp(argnext[0],argnext);\r\n\r\n\t\t\t\tif(remove(\"\/tmp\/tempfile\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"remove error\\n\");\r\n\t\t\t\t}\r\n\t\t\t\texit(0);\r\n\t\t\t}<\/pre>\n<p>\u4e0a\u51fa1\uff5e4\u5904\u4ee3\u7801\u9700\u8981\u4e00\u4e2aswitch\u8bed\u53e5\u6765\u7ec4\u7ec7\uff0c\u6839\u636ehow\u53c2\u6570\u6765\u9009\u62e9\u76f8\u5e94\u4ee3\u7801\uff0c\u8fdb\u884c\u6267\u884c\u3002\u53e6\u5916\uff0c\u7531\u4e8e\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u8bbe\u8ba1\u4e24\u6b21fork\u8fdb\u7a0b\uff0c\u56e0\u6b64\u8981\u5f04\u6e05\u695a\u7236\u5b50\u8fdb\u7a0b\u7684\u5173\u7cfb\uff0c\u5176\u6b21\u8fd8\u9700\u4e86\u89e3\u4ee3\u78014\u4e2dwaitpid\u51fd\u6570\u7684\u4f5c\u7528\u3002\u7531\u4e8e\u5b50\u5b50\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u540c\u7ec4\uff0c\u56e0\u6b64\u5b50\u8fdb\u7a0b\u7b49\u5f85\u5b50\u5b50\u8fdb\u7a0b\u7ed3\u675f\u3002<\/p>\n<p>\u540c\u6837\uff0c\u7236\u8fdb\u7a0b\u9700\u8981\u7b49\u5f85\u5b50\u8fdb\u7a0b\u6267\u884c\u5b8c\u6bd5\u3002\u4f46\u662f\u5982\u679c\u547d\u4ee4\u884c\u4e2d\u5305\u542b\u540e\u53f0\u8fd0\u884c\u7236&amp;\uff0c\u90a3\u4e48\u9644\u8fd1\u6210\u53ef\u76f4\u63a5\u8fd4\u56de\uff0c\u4e0d\u7528\u7b49\u5f85\u5b50\u8fdb\u7a0b\u3002\u8fd9\u4e9b\u529f\u80fd\u7684\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\tif(background==1)\r\n\t{\r\n\t\tprintf(\"process id %d\\n\",pid);\r\n\t}\r\n\r\n\tif(waitpid(pid,&amp;status,0)==-1)\r\n\t{\r\n\t\tprintf(\"wait for child process error\\n\");\r\n\t}<\/pre>\n<p>\u81f3\u6b64\uff0c\u6211\u4eec\u5206\u6790\u5b8c\u4e86do_cmd\u51fd\u6570\u7684\u529f\u80fd\uff0c\u5b8c\u6574\u4ee3\u7801\u53ef\u4ee5\u53c2\u8003\u8fd9\u91cc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u4e09\u7684\u65f6\u5019\uff0c\u90a3\u65f6\u5019\u56e0\u4e3a\u8bfe\u7a0b\u9700\u8981\uff0c\u6211\u4eec\u8c03\u8bd5\u8fc7my_shell.c\u7a0b\u5e8f\u3002\u5f53\u65f6\u53ea\u662f\u5bf9\u6574\u4e2a\u7a0b\u5e8f\u7684\u7ed3\u6784\u4e86\u89e3\uff0c\u5728\u6d89\u53calin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[109,108,107,116],"class_list":["post-806","post","type-post","status-publish","format-standard","hentry","category-linuxc","tag-c","tag-linux","tag-107","tag-116"],"views":5415,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/comments?post=806"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/806\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=806"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}