{"id":399,"date":"2021-07-28T17:30:20","date_gmt":"2021-07-28T09:30:20","guid":{"rendered":"https:\/\/egonlin.com\/?p=399"},"modified":"2023-01-28T14:43:50","modified_gmt":"2023-01-28T06:43:50","slug":"%e7%ac%ac%e5%9b%9b%e8%8a%82%ef%bc%9afor%e5%be%aa%e7%8e%af","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=399","title":{"rendered":"\u7b2c\u56db\u8282\uff1afor\u5faa\u73af"},"content":{"rendered":"<h1>\u6d41\u7a0b\u63a7\u5236\u4e4bfor\u5faa\u73af<\/h1>\n<h2>\u4e00 \u8bed\u6cd5<\/h2>\n<pre><code class=\"language-python\">#===========\u300bShell\u98ce\u683c\u8bed\u6cd5\nfor \u53d8\u91cf\u540d [ in \u53d6\u503c\u5217\u8868 ]\ndo\n    \u5faa\u73af\u4f53\ndone\n\n#===========\u300bC\u8bed\u8a00\u98ce\u683c\u8bed\u6cd5\nfor ((\u521d\u503c;\u6761\u4ef6;\u6b65\u957f))\ndo  \n    \u5faa\u73af\u4f53\ndone<\/code><\/pre>\n<p>shell\u98ce\u683c\u7684for\uff0c\u5e38\u7528in\u5217\u8868\u65b9\u5f0f<\/p>\n<pre><code class=\"language-python\">for i in 1 2 3\nfor i in {1,2,3}\nfor i in {1..9}\nfor i in {9..1}\nfor i in {a..z}\nfor i in {A..Z}\nfor i in {X..Z}\nfor i in $(\u547d\u4ee4)  # \u4f8b\u5982\uff1afor i in $(head -10 \/etc\/passwd);do echo $i|cut -d: -f1,2;done\nfor i in $(find ...)<\/code><\/pre>\n<p>continue\u4e0efor<\/p>\n<pre><code class=\"language-python\">continue\uff1a\u9ed8\u8ba4\u9000\u51fa\u672c\u6b21\u5faa\u73af\n\nbreak\uff1a\u9ed8\u8ba4\u9000\u51fa\u672c\u5c42\u5faa\u73af<\/code><\/pre>\n<h2>\u4e8c \u6848\u4f8b<\/h2>\n<p>\u6848\u4f8b1\uff1ashell\u98ce\u683c\u7684for<\/p>\n<pre><code class=\"language-python\">for i in {1..10}\ndo\n    echo $i\ndone<\/code><\/pre>\n<p>\u6848\u4f8b2\uff1ac\u8bed\u8a00\u98ce\u683c\u7684for<\/p>\n<pre><code class=\"language-python\">for ((i=1;i&lt;=10;i++))\ndo\n    echo $i\ndone<\/code><\/pre>\n<p>\u6848\u4f8b3\uff1a\u68c0\u67e5\u5185\u7f51\u5b58\u6d3b\u7684ip\uff0c\u4f7f\u7528&amp;\u7b26\u53f7\u63d0\u5347\u811a\u672c\u7684\u8fd0\u884c\u6548\u7387<\/p><div id=\"rml_readmorelogin_placeholder\" style=\"position:relative;\"><div id=\"rml_fade_content\" style=\"position: absolute;\r\ntop:-10em;\r\nwidth:100%;\r\nheight:10em;\r\nbackground: -webkit-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -moz-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -o-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -ms-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\"><\/div><div class=\"wpf-controller aru_rml_from_in_post\" style=\"background-color:#eeeeee;border:5px solid #cce6ff;\" id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><h2 id=\"Header\">\u67e5\u770b\u66f4\u591a<\/h2><div id=\"Message\"><p>\u8054\u7cfb\u7ba1\u7406\u5458\u5fae\u4fe1tutu19192010\uff0c\u6ce8\u518c\u8d26\u53f7<\/p>\n<\/div><div id=\"StatusBarHeader\"><\/div><form id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><input name=\"post_id\" value=\"399\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"399\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"f90652866f\" type=\"hidden\"\/><input name=\"_wpnonce\" value=\"7755f0f36d\" type=\"hidden\"\/><input name=\"_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_proxy_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_view\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginView\" type=\"hidden\"\/><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\" width=\"400px\"><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Username:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"username\" value=\"\" type=\"text\"\/><\/td><\/tr><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Password:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"password\" value=\"\" type=\"password\"\/><\/td><\/tr><\/tbody><\/table><p class=\"wpf-table-placeholder submit\"><button class=\"wp_plugin_framework_ajax_button\" type=\"button\" style=\"background-color:#4D90FE;;color:#ffffff;;border:1px solid #3079ed;\" name=\"_event\" value=\"ButtonLogin\">Log in<\/button><\/p><\/td><td class=\"wpf-table-placeholder-input\"><\/td><\/tr><\/tbody><\/table><\/form><div id=\"ButtonStartRegister\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=register\">Register<\/a><\/div><div id=\"Link1\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=lostpassword\">Forgotten username or password?<\/a><\/div><div id=\"StatusBarFooter\"><\/div><\/div><\/div><div id=aru_remaining_content><\/div>","protected":false},"excerpt":{"rendered":"<p>\u6d41\u7a0b\u63a7\u5236\u4e4bfor\u5faa\u73af \u4e00 \u8bed\u6cd5 #===========\u300bShell\u98ce\u683c\u8bed\u6cd5 for \u53d8\u91cf\u540d [ in \u53d6\u503c\u5217 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[61,451],"tags":[21,19,75,22,20],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/399"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}