{"id":40262,"date":"2024-11-26T10:15:14","date_gmt":"2024-11-26T02:15:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/40262\/"},"modified":"2024-11-26T10:15:14","modified_gmt":"2024-11-26T02:15:14","slug":"linux-%e5%91%bd%e4%bb%a4%e8%a1%8c%e4%b8%8b%e7%9a%84%e6%95%b0%e5%ad%a6%e8%bf%90%e7%ae%97","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/40262\/","title":{"rendered":"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14pt\">expr<\/span> <\/p>\n<p style=\"text-align: left\"><span style=\"font-family: arial, helvetica, sans-serif\">&nbsp; &nbsp; <\/span><span style=\"font-family: arial, helvetica, sans-serif\">\u9996\u5148\uff0c\u5bf9\u4e8e\u5728\u547d\u4ee4\u884c\u4f7f\u7528\u547d\u4ee4\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\uff0c\u53ef\u80fd\u6700\u5bb9\u6613\u60f3\u5230\u3001\u6700\u5e38\u7528\u7684\u547d\u4ee4\u5c31\u662f&nbsp;expr&nbsp;\uff08\u8868\u8fbe\u5f0fexpression\u3002\u5b83\u53ef\u4ee5\u5b8c\u6210\u56db\u5219\u8fd0\u7b97\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6bd4\u8f83\u5927\u5c0f\u3002\u4e0b\u9762\u662f\u51e0\u4e2a\u4f8b\u5b50\uff1a<\/span><\/p>\n<p><span><strong>\u53d8\u91cf\u9012\u589e<\/strong><\/span> <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380879189.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe\" \/><\/p>\n<p><span><strong>\u5b8c\u6210\u7b80\u5355\u8fd0\u7b97<\/strong><\/span> <\/p>\n<p>&nbsp;&nbsp;<img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380826900.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe1\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe1\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u6ce8\u610f\uff0c\u4f60\u9700\u8981\u5728&nbsp;*&nbsp;\u8fd0\u7b97\u7b26\u4e4b\u524d\u589e\u52a0&nbsp;&nbsp;\u7b26\u53f7\uff0c\u907f\u514d\u8bed\u6cd5\u9519\u8bef\uff08\u6ce8\uff1a*&nbsp;\u662f bash \u7684\u901a\u914d\u7b26\uff0c\u56e0\u6b64\u9700\u8981\u7528&nbsp;&nbsp;\u8f6c\u4e49\uff0c\u4e0b\u9762\u7684&nbsp;&gt;&nbsp;\u4e5f\u662f\u7531\u4e8e\u662f bash \u7684\u7ba1\u9053\u7b26\u800c\u9700\u8981\u8f6c\u4e49\uff09\u3002%&nbsp;\u8fd0\u7b97\u7b26\u7528\u4e8e\u53d6\u4f59\u8fd0\u7b97\u3002&nbsp;<\/span><\/p>\n<p><span style=\"color: #000000;letter-spacing: 2px;border-left: 3px solid #ff3030;border-right: 3px solid #ff3030;padding-left: 8px;padding-right: 8px;font-size: 12pt;font-family: arial, helvetica, sans-serif\"><strong>\u4e0b\u9762\u662f\u4e00\u4e2a\u7a0d\u5fae\u590d\u6742\u7684\u4f8b\u5b50\uff1a<\/strong><\/span> <\/p>\n<p>&nbsp; <img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380822809.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe2\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe2\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u5047\u8bbe\u67d0\u4e2a\u6d3b\u52a8\u4e2d\u6709 11 \u4f4d\u53c2\u4e0e\u8005\uff0c\u9700\u8981\u9881\u53d1\u7684\u5956\u9879\u603b\u6570\u4e3a 156\uff0c\u90a3\u4e48\u5e73\u5747\u6bcf\u4e2a\u53c2\u4e0e\u8005\u83b7\u5f97 14 \u9879\u5956\u9879\uff0c\u989d\u5916\u5269\u4f59 2 \u4e2a\u5956\u9879\u3002<\/span><\/p>\n<p><span><strong>\u6bd4\u8f83<\/strong><\/span> <\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">&nbsp; &nbsp; \u4e0b\u9762\u8ba9\u6211\u4eec\u770b\u4e00\u4e0b\u6bd4\u8f83\u7684\u64cd\u4f5c\u3002\u4ece\u7b2c\u4e00\u5370\u8c61\u6765\u770b\uff0c\u8bed\u53e5\u770b\u4f3c\u6709\u4e9b\u602a\u5f02\uff1b\u8fd9\u91cc\u5e76\u4e0d\u662f\u8bbe\u7f6e\u6570\u503c\uff0c\u800c\u662f\u8fdb\u884c\u6570\u5b57\u6bd4\u8f83\u3002\u5728\u672c\u4f8b\u4e2d&nbsp;expr&nbsp;\u5224\u65ad\u8868\u8fbe\u5f0f\u662f\u5426\u4e3a\u771f\uff1a\u5982\u679c\u7ed3\u679c\u662f 1\uff0c\u90a3\u4e48\u8868\u8fbe\u5f0f\u4e3a\u771f\uff1b\u53cd\u4e4b\uff0c\u8868\u8fbe\u5f0f\u4e3a\u5047\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380840499.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe3\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe3\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u8bf7\u8bfb\u4f5c\u201c11 \u662f\u5426\u7b49\u4e8e 11\uff1f\u201d\u53ca\u201c11 \u662f\u5426\u7b49\u4e8e 12\uff1f\u201d\uff0c\u4f60\u5f88\u5feb\u5c31\u4f1a\u4e60\u60ef\u8fd9\u79cd\u5199\u6cd5\u3002\u5f53\u7136\uff0c\u6211\u4eec\u4e0d\u4f1a\u5728\u547d\u4ee4\u884c\u4e0a\u6267\u884c\u4e0a\u8ff0\u6bd4\u8f83\uff0c\u53ef\u80fd\u7684\u6bd4\u8f83<\/span><br \/><span style=\"font-family: arial, helvetica, sans-serif\">\u662f&nbsp;$age&nbsp;\u662f\u5426\u7b49\u4e8e&nbsp;11\u3002<\/span><br \/> &nbsp;&nbsp;<img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380937589.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe4\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe4\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; &nbsp;\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u4eec\u5224\u65ad 10 \u662f\u5426\u5927\u4e8e 5\uff0c\u4ee5\u53ca\u662f\u5426\u5927\u4e8e 99\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380966807.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe5\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe5\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u7684\u786e\uff0c\u8fd4\u56de 1 \u548c 0 \u5206\u522b\u4ee3\u8868\u6bd4\u8f83\u7684\u7ed3\u679c\u4e3a\u771f\u548c\u5047\uff0c\u6211\u4eec\u4e00\u822c\u9884\u671f\u5728 Linux \u4e0a\u5f97\u5230\u8fd9\u4e2a\u7ed3\u679c\u3002\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u6309\u7167\u4e0a\u8ff0\u903b\u8f91\u4f7f\u7528&nbsp;expr&nbsp;\u5e76\u4e0d\u6b63\u786e\uff0c\u56e0\u4e3a&nbsp;if&nbsp;\u7684\u5de5\u4f5c\u539f\u7406\u521a\u597d\u76f8\u53cd\uff0c\u5373 0 \u4ee3\u8868\u771f\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380993259.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe6\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe6\" \/><br \/><span style=\"max-width:90%\"><strong>\u4e0b\u9762\uff0c\u6211\u4eec\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c\uff1a<\/strong><\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380972496.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe7\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe7\" \/><br \/><span style=\"max-width:90%\"><strong>\u8fd9\u663e\u7136\u4e0e\u6211\u4eec\u9884\u671f\u4e0d\u7b26\uff01\u6211\u4eec\u7a0d\u5fae\u4fee\u6539\u4e00\u4e0b\uff0c\u4ee5\u4fbf\u4f7f\u5176\u6309\u6211\u4eec\u9884\u671f\u5de5\u4f5c\uff1a<\/strong><\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208380988120.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe8\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe8\" \/><\/p>\n<p><span><strong>factor<\/strong><\/span> <\/p>\n<p>factor&nbsp;<span style=\"font-family: arial, helvetica, sans-serif\">\u547d\u4ee4\u7684\u529f\u80fd\u57fa\u672c\u4e0e\u4f60\u9884\u671f\u76f8\u7b26\u3002\u4f60\u7ed9\u51fa\u4e00\u4e2a\u6570\u5b57\uff0c\u8be5\u547d\u4ee4\u4f1a\u7ed9\u51fa\u5bf9\u5e94\u6570\u5b57\u7684\u56e0\u5b50\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381068271.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe9\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe9\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u6ce8\uff1afactor&nbsp;\u547d\u4ee4\u5bf9\u4e8e\u6700\u540e\u4e00\u4e2a\u6570\u5b57\u6ca1\u6709\u8fd4\u56de\u66f4\u591a\u56e0\u5b50\uff0c\u8fd9\u662f\u56e0\u4e3a 1987 \u662f\u4e00\u4e2a\u3002<\/span><\/p>\n<p><span>jot<\/span> <\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">&nbsp; &nbsp; jot&nbsp;\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u4e00\u7cfb\u5217\u6570\u5b57\u3002\u7ed9\u5b9a\u6570\u5b57\u603b\u6570\u53ca\u8d77\u59cb\u6570\u5b57\u5373\u53ef\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381091782.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe10\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe10\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u4f60\u4e5f\u53ef\u4ee5\u7528\u5982\u4e0b\u65b9\u5f0f\u4f7f\u7528&nbsp;jot\uff0c\u8fd9\u91cc\u6211\u4eec\u8981\u6c42\u9012\u51cf\u81f3\u6570\u5b57 2\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381060169.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe11\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe11\" \/><br \/> jot&nbsp;\u53ef\u4ee5\u5e2e\u4f60\u6784\u9020\u4e00\u7cfb\u5217\u6570\u5b57\u7ec4\u6210\u7684\u5217\u8868\uff0c\u8be5\u5217\u8868\u53ef\u4ee5\u7528\u4e8e\u5176\u5b83\u4efb\u52a1\u3002<br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381071130.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe12\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe12\" \/><\/p>\n<p><span>bc<\/span> <\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">&nbsp; &nbsp; bc&nbsp;\u57fa\u672c\u4e0a\u662f\u547d\u4ee4\u884c\u6570\u5b66\u8fd0\u7b97\u6700\u4f73\u5de5\u5177\u4e4b\u4e00\u3002\u8f93\u5165\u4f60\u60f3\u6267\u884c\u7684\u8fd0\u7b97\uff0c\u4f7f\u7528\u7ba1\u9053\u53d1\u9001\u81f3\u8be5\u547d\u4ee4\u5373\u53ef\uff1a<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381167002.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe13\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe13\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u53ef\u89c1&nbsp;bc&nbsp;\u5e76\u6ca1\u6709\u5ffd\u7565\u7cbe\u5ea6\uff0c\u800c\u4e14\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u4e5f\u76f8\u5f53\u76f4\u622a\u4e86\u5f53\u3002\u5b83\u8fd8\u53ef\u4ee5\u8fdb\u884c\u5927\u5c0f\u6bd4\u8f83\u3001\u5904\u7406\u5e03\u5c14\u503c\u3001\u8ba1\u7b97\u5e73\u65b9\u6839\u3001\u6b63\u5f26\u3001\u4f59\u5f26\u548c\u6b63\u5207\u7b49\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381162784.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe14\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe14\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u4e8b\u5b9e\u4e0a\uff0cbc&nbsp;\u751a\u81f3\u53ef\u4ee5\u8ba1\u7b97 pi\u3002\u4f60\u9700\u8981\u6307\u5b9a\u9700\u8981\u7684\u7cbe\u5ea6\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381120417.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe15\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe15\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u9664\u4e86\u901a\u8fc7\u7ba1\u9053\u63a5\u6536\u6570\u636e\u5e76\u8fd4\u56de\u7ed3\u679c\uff0cbc\u8fd8\u53ef\u4ee5\u4ea4\u4e92\u5f0f\u8fd0\u884c\uff0c\u8f93\u5165\u4f60\u60f3\u6267\u884c\u7684\u8fd0\u7b97\u5373\u53ef\u3002\u672c\u4f8b\u4e2d\u63d0\u5230\u7684&nbsp;scale&nbsp;\u8bbe\u7f6e\u53ef\u4ee5\u6307\u5b9a\u6709\u6548\u6570\u5b57\u7684\u4e2a\u6570\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381116590.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe16\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe16\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528&nbsp;bc&nbsp;\u5b8c\u6210\u6570\u5b57\u8fdb\u5236\u8f6c\u6362\u3002obase&nbsp;\u7528\u4e8e\u8bbe\u7f6e\u8f93\u51fa\u7684\u6570\u5b57\u8fdb\u5236\u3002<\/span><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381143752.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe17\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe17\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u6309\u5982\u4e0b\u65b9\u5f0f\u4f7f\u7528&nbsp;bc&nbsp;\u4e5f\u662f\u5b8c\u6210\u5341\u516d\u8fdb\u5236\u4e0e\u5341\u8fdb\u5236\u8f6c\u6362\u7684\u6700\u7b80\u5355\u65b9\u5f0f\u4e4b\u4e00\uff1a<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381214260.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe18\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe18\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u5728\u4e0a\u9762\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u5c06\u8f93\u5165\u8fdb\u5236\uff08ibase\uff09\u8bbe\u7f6e\u4e3a\u5341\u516d\u8fdb\u5236\uff08hex\uff09\uff0c\u5b8c\u6210\u5341\u516d\u8fdb\u5236\u5230\u4e3a\u5341\u8fdb\u5236\u7684\u8f6c\u6362\u3002\u5728\u7b2c\u4e8c\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u6267\u884c\u76f8\u53cd\u7684\u64cd\u4f5c\uff0c\u5373\u5c06\u8f93\u51fa\u8fdb\u5236\uff08obase\uff09\u8bbe\u7f6e\u4e3a\u5341\u516d\u8fdb\u5236\u3002<\/span><\/p>\n<p><span>\u7b80\u5355\u7684 bash \u6570\u5b66\u8fd0\u7b97<\/span> <\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">&nbsp; &nbsp; \u901a\u8fc7\u4f7f\u7528\u53cc\u62ec\u53f7\uff0c\u6211\u4eec\u53ef\u4ee5\u5728 bash \u4e2d\u5b8c\u6210\u7b80\u5355\u7684\u6570\u5b66\u8fd0\u7b97\u3002\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf\uff0c\u4e3a\u53d8\u91cf\u8d4b\u503c\uff0c\u7136\u540e\u4f9d\u6b21\u6267\u884c\u52a0\u6cd5\u3001\u81ea\u51cf\u548c\u5e73\u65b9\u3002<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381286287.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe19\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe19\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u5141\u8bb8\u4f7f\u7528\u7684\u8fd0\u7b97\u7b26\u5305\u62ec\uff1a<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381274693.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe20\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe20\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528\u903b\u8f91\u8fd0\u7b97\u7b26\u548c\u5e03\u5c14\u8fd0\u7b97\u7b26\uff1a<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381212411.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe21\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe21\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u6216\u8005\u5982\u4e0b\u65b9\u5f0f\uff1a<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381375195.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe22\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe22\" \/><br \/><span style=\"max-width:90%\">&nbsp; &nbsp; \u4e0b\u9762\u8ba1\u7b97 2 \u7684 3 \u6b21\u5e42\uff1a<\/span><br \/><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173208381387653.jpg\" class=\"aligncenter\" title=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe23\" alt=\"Linux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u63d2\u56fe23\" \/><\/p>\n<p><span><strong>\u603b\u7ed3<\/strong><\/span> <\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">&nbsp; &nbsp; \u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u6709\u5f88\u591a\u4e0d\u540c\u7684\u547d\u4ee4\u884c\u5de5\u5177\u53ef\u4ee5\u5b8c\u6210\u6570\u5b57\u8fd0\u7b97\u3002\u5e0c\u671b\u4f60\u5728\u8bfb\u5b8c\u672c\u6587\u4e4b\u540e\uff0c\u80fd\u638c\u63e1\u4e00\u4e24\u4e2a\u5de5\u5177\u3002<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\"><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\">\u4f5c\u8005\uff1a<span style=\"color: #ff0000\">Sandra Henry-Stocker<\/span>&nbsp;\u9009\u9898\uff1a<span style=\"color: #ff0000\">lujun9972<\/span>&nbsp;<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif\"><\/span><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fLinux \u547d\u4ee4\u884c\u4e0b\u7684\u6570\u5b66\u8fd0\u7b97\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; expr &nbsp; &nbsp; \u9996\u5148\uff0c\u5bf9\u4e8e\u5728\u547d\u4ee4\u884c\u4f7f\u7528\u547d\u4ee4\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\uff0c\u53ef\u80fd\u6700\u5bb9\u6613\u60f3\u5230\u3001\u6700\u5e38\u7528\u7684\u547d\u4ee4\u5c31\u662f&nbsp;expr&nbsp;\uff08\u8868\u8fbe\u5f0fexpression\u3002\u5b83\u53ef\u4ee5\u5b8c\u6210\u56db\u5219\u8fd0\u7b97\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6bd4\u8f83\u5927\u5c0f\u3002\u4e0b\u9762\u662f\u51e0\u4e2a\u4f8b\u5b50\uff1a \u53d8\u91cf\u9012\u589e \u5b8c\u6210\u7b80\u5355\u8fd0\u7b97 &nbsp;&nbsp;&nbsp; &nbsp; \u6ce8\u610f\uff0c\u4f60\u9700\u8981\u5728&nbsp;*&nbsp;\u8fd0\u7b97\u7b26\u4e4b\u524d\u589e\u52a0&nbsp;&nbsp;\u7b26\u53f7\uff0c\u907f\u514d\u8bed\u6cd5\u9519\u8bef\uff08\u6ce8\uff1a*&nbsp;\u662f bash \u7684\u901a\u914d\u7b26\uff0c\u56e0\u6b64\u9700\u8981\u7528&nbsp;&nbsp;\u8f6c\u4e49\uff0c\u4e0b\u9762\u7684&nbsp;&gt;&nbsp;\u4e5f\u662f\u7531\u4e8e\u662f bash \u7684\u7ba1\u9053\u7b26\u800c\u9700\u8981\u8f6c\u4e49\uff09\u3002%&nbsp;\u8fd0\u7b97\u7b26\u7528\u4e8e\u53d6\u4f59\u8fd0\u7b97\u3002&nbsp; \u4e0b\u9762\u662f\u4e00\u4e2a\u7a0d\u5fae\u590d\u6742\u7684\u4f8b\u5b50\uff1a &nbsp; &nbsp; &nbsp; \u5047\u8bbe\u67d0\u4e2a\u6d3b\u52a8\u4e2d\u6709 11 \u4f4d\u53c2\u4e0e\u8005\uff0c\u9700\u8981\u9881\u53d1\u7684\u5956\u9879\u603b\u6570\u4e3a 156\uff0c\u90a3\u4e48\u5e73\u5747\u6bcf\u4e2a\u53c2\u4e0e\u8005\u83b7\u5f97 14 \u9879\u5956\u9879\uff0c\u989d\u5916\u5269\u4f59 2 \u4e2a\u5956\u9879\u3002 \u6bd4\u8f83 &nbsp; &nbsp; \u4e0b\u9762\u8ba9\u6211\u4eec\u770b\u4e00\u4e0b\u6bd4\u8f83\u7684\u64cd\u4f5c\u3002\u4ece\u7b2c\u4e00\u5370\u8c61\u6765\u770b\uff0c\u8bed\u53e5\u770b\u4f3c\u6709\u4e9b\u602a\u5f02\uff1b\u8fd9\u91cc\u5e76\u4e0d\u662f\u8bbe\u7f6e\u6570\u503c\uff0c\u800c\u662f\u8fdb\u884c\u6570\u5b57\u6bd4\u8f83\u3002\u5728\u672c\u4f8b\u4e2d&nbsp;expr&nbsp;\u5224\u65ad\u8868\u8fbe\u5f0f\u662f\u5426\u4e3a\u771f\uff1a\u5982\u679c\u7ed3\u679c\u662f 1\uff0c\u90a3\u4e48\u8868\u8fbe\u5f0f\u4e3a\u771f\uff1b\u53cd\u4e4b\uff0c\u8868\u8fbe\u5f0f\u4e3a\u5047\u3002&nbsp; &nbsp; \u8bf7\u8bfb\u4f5c\u201c11 \u662f\u5426\u7b49\u4e8e 11\uff1f\u201d\u53ca\u201c11 \u662f\u5426\u7b49\u4e8e 12\uff1f\u201d\uff0c\u4f60\u5f88\u5feb\u5c31\u4f1a\u4e60\u60ef\u8fd9\u79cd\u5199\u6cd5\u3002\u5f53\u7136\uff0c\u6211\u4eec\u4e0d\u4f1a\u5728\u547d\u4ee4\u884c\u4e0a\u6267\u884c\u4e0a\u8ff0\u6bd4\u8f83\uff0c\u53ef\u80fd\u7684\u6bd4\u8f83\u662f&nbsp;$age&nbsp;\u662f\u5426\u7b49\u4e8e&nbsp;11\u3002 &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u4eec\u5224\u65ad 10 \u662f\u5426\u5927\u4e8e 5\uff0c\u4ee5\u53ca\u662f\u5426\u5927\u4e8e 99\u3002&nbsp; &nbsp; \u7684\u786e\uff0c\u8fd4\u56de 1 \u548c 0 \u5206\u522b\u4ee3\u8868\u6bd4\u8f83\u7684\u7ed3\u679c\u4e3a\u771f\u548c\u5047\uff0c\u6211\u4eec\u4e00\u822c\u9884\u671f\u5728 Linux \u4e0a\u5f97\u5230\u8fd9\u4e2a\u7ed3\u679c\u3002\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u6309\u7167\u4e0a\u8ff0\u903b\u8f91\u4f7f\u7528&nbsp;expr&nbsp;\u5e76\u4e0d\u6b63\u786e\uff0c\u56e0\u4e3a&nbsp;if&nbsp;\u7684\u5de5\u4f5c\u539f\u7406\u521a\u597d\u76f8\u53cd\uff0c\u5373 0 \u4ee3\u8868\u771f\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c\uff1a\u8fd9\u663e\u7136\u4e0e\u6211\u4eec\u9884\u671f\u4e0d\u7b26\uff01\u6211\u4eec\u7a0d\u5fae\u4fee\u6539\u4e00\u4e0b\uff0c\u4ee5\u4fbf\u4f7f\u5176\u6309\u6211\u4eec\u9884\u671f\u5de5\u4f5c\uff1a factor [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-40262","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/40262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=40262"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/40262\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=40262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=40262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=40262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}