{"id":1568,"date":"2019-04-07T19:35:02","date_gmt":"2019-04-07T10:35:02","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=1568"},"modified":"2021-10-14T15:48:10","modified_gmt":"2021-10-14T06:48:10","slug":"%e3%81%99%e3%81%94%e3%81%84%e8%a9%b3%e3%81%97%e3%81%84bash%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%81%ae%e8%89%b2%e3%80%85%e3%81%aa%e3%82%84%e3%82%8a%e6%96%b9","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=1568","title":{"rendered":"Bash\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u30b3\u30e1\u30f3\u30c8\u306e\u8272\u3005\u306a\u3084\u308a\u65b9"},"content":{"rendered":"<p>Bash\u8a00\u8a9e\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u306e\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0\u306b\u304a\u3044\u3066\u3001\u30b3\u30e1\u30f3\u30c8\u306e\u65b9\u6cd5\u306b\u306f\u5b9f\u306b\u8272\u3005\u306a\u3084\u308a\u65b9\u304c\u3042\u308a\u307e\u3059\u3002\u4e00\u884c\u30b3\u30e1\u30f3\u30c8\u3084\u8907\u6570\u884c\u3001\u30de\u30eb\u30c1\u30e9\u30a4\u30f3\u306e\u30b3\u30e1\u30f3\u30c8\u3001\u3061\u3087\u3063\u3068\u9762\u767d\u3044\u81ea\u6162\u3057\u305f\u304f\u306a\u308b\u3088\u3046\u306a\u3084\u308a\u65b9\u306a\u3069\u3001\u4f7f\u3044\u5206\u3051\u3089\u308c\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<hr>\n<p>Bash\u306e\u30b3\u30e1\u30f3\u30c8\u65b9\u6cd5\u306b\u306f\u69d8\u3005\u306a\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u4f7f\u3044\u5206\u3051\u3089\u308c\u308b\u3068\u4fbf\u5229\u3067\u3059\u3088\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">1<\/span> #\u3092\u4f7f\u3063\u305f\u4e00\u822c\u7684\u306a\u30b3\u30e1\u30f3\u30c8<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">2<\/span> :\u3092\u4f7f\u3063\u305f\u30b3\u30e1\u30f3\u30c8<\/a><\/li><li><a href=\"#_ltltEOT\"><span class=\"toc_number toc_depth_1\">3<\/span> : &lt;&lt;'EOT'\u3092\u4f7f\u3063\u305f\u6c4e\u7528\u7684\u306a\u30b3\u30e1\u30f3\u30c8<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_1\">4<\/span> `\u3092\u4f7f\u3063\u305f\u30a4\u30f3\u30e9\u30a4\u30f3\u30b3\u30e1\u30f3\u30c8<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\"><code>#<\/code>\u3092\u4f7f\u3063\u305f\u4e00\u822c\u7684\u306a\u30b3\u30e1\u30f3\u30c8<\/span><\/h2>\n<pre><code># comment here.\n<\/code><\/pre>\n<p>\u4e00\u822c\u7684\u306a\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<h2><span id=\"i-2\"><code>:<\/code>\u3092\u4f7f\u3063\u305f\u30b3\u30e1\u30f3\u30c8<\/span><\/h2>\n<pre><code>: comment\n<\/code><\/pre>\n<p>&#8220;\u4f55\u3082\u3057\u306a\u3044&#8221;\u3092\u3059\u308b<code>:<\/code>\u306b\u6e21\u3055\u308c\u305f\u30a2\u30e9\u30b0\u30e1\u30f3\u30c4\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002\u3057\u304b\u3057\u3053\u3061\u3089\u306f\u7121\u8996\u3055\u308c\u306a\u3044\u6587\u5b57\u5217\u3082\u3042\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<\/p>\n<pre><code>: comment here\n<\/code><\/pre>\n<p>\u307f\u305f\u3044\u306b\u4e00\u822c\u7684\u306a\u6587\u5b57\u3001\u6570\u5b57\u3060\u3051\u306a\u3089\u554f\u984c\u306a\u3044\u3067\u3059\u304c\u3001<\/p>\n<pre><code>: `comment here`\n<\/code><\/pre>\n<p>\u306e\u3088\u3046\u306b\u7279\u5b9a\u306e\u7279\u6b8a\u8a18\u53f7\u304c\u5165\u3063\u3066\u3044\u308b\u3068\u554f\u7b54\u7121\u76ca\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308a\u3001\u904b\u304c\u60aa\u3044\u3068\u30b7\u30b9\u30c6\u30e0\u304c\u58ca\u308c\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u5272\u3068\u4f7f\u3044\u52dd\u624b\u304c\u3044\u3044\u306e\u3067\u3001\u5834\u6240\u3092\u8003\u3048\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><code>:<\/code>\u306f\u4f55\u3082\u3057\u306a\u3044\u3092\u3059\u308b\u308f\u3051\u306a\u306e\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u30c7\u30d0\u30c3\u30b0\u7684\u306b\u51fa\u529b\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u50d5\u306e\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u50d5\u306f\u3088\u304f\u95a2\u6570\u304c\u3069\u3046\u3044\u3046\u30b3\u30fc\u30c9\u306a\u306e\u304b\u3001\u4f7f\u3044\u65b9\u306f\u3001\u5f15\u6570\u306f\u4f55\u3092\u6e21\u3059\u304b\u3001\u307f\u305f\u3044\u306a\u3053\u3068\u3092\u5fd8\u308c\u307e\u3059\u3002\u3044\u3061\u3044\u3061<code>--help<\/code>\u3092\u5b9f\u88c5\u3057\u305f\u308a\u3057\u3066\u3082\u3044\u3044\u3093\u3067\u3059\u3051\u3069\u9762\u5012\u3067\u3059\u306d\u3002\u305d\u3053\u3067<\/p>\n<pre><code>parsejson(){\n    : e.g. parsejson '[0][\"title\"]'\n    python3 -c \"import json,sys;print(json.load(sys.stdin)${1})\"\n}\n\n<\/code><\/pre>\n<p>\u307f\u305f\u3044\u306b\u4f7f\u3044\u65b9\u3092\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u4e45\u3057\u3076\u308a\u306b<code>parsejson<\/code>\u3092\u4f7f\u304a\u3046\u3068\u601d\u3063\u305f\u3068\u304d\u306b\u3001\u3069\u3046\u4f7f\u3046\u3093\u3060\u3063\u3051\u3001\u3068\u5c11\u3057\u3067\u3082\u4e0d\u5b89\u306b\u306a\u3063\u305f\u3089\u3001<code>type parsejson<\/code>\u3067\u30b3\u30fc\u30c9\u3092\u305d\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u542b\u3081\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre><code>yuis on ASUS at \/mnt\/c\/pg$ type parsejson\nparsejson is a function\nparsejson ()\n{\n    : e.g. parsejson '[0][\"title\"]';\n    python3 -c \"import json,sys;print(json.load(sys.stdin)${1})\"\n}\n\n<\/code><\/pre>\n<p>\u3042\u3042\u3001<code>parsejson '[0][\"title\"]'<\/code>\u307f\u305f\u3044\u306b\u4f7f\u3046\u306e\u304b\u3001\u3068\u308f\u304b\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<h2><span id=\"_ltltEOT\"><code>: &lt;&lt;'EOT'<\/code>\u3092\u4f7f\u3063\u305f\u6c4e\u7528\u7684\u306a\u30b3\u30e1\u30f3\u30c8<\/span><\/h2>\n<pre><code>: &lt;&lt;'EOT'\n\ncomment here.\n\nEOT\n<\/code><\/pre>\n<p>\u30d2\u30a2\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001&#8221;\u4f55\u3082\u3057\u306a\u3044&#8221;\u3092\u3059\u308b<code>:<\/code>\u306b\u30d1\u30a4\u30d7\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u50d5\u7684\u306b\u306f\u4e00\u756a\u304a\u3059\u3059\u3081\u306e\u30b3\u30e1\u30f3\u30c8\u306e\u4ed5\u65b9\u3067\u3059\u3002<\/p>\n<p>\u524d\u9805\u306e<code>:<\/code>\u5358\u4f53\u306b\u6bd4\u3079\u3066\u3001\u3053\u3061\u3089\u306f\u3069\u3046\u3044\u3046\u7279\u6b8a\u6587\u5b57\u304c\u5165\u3063\u3066\u3044\u3066\u3082\u30d2\u30a2\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306a\u306e\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u8907\u6570\u884c\u306e\u9577\u3044\u30b3\u30e1\u30f3\u30c8\u306b\u306a\u308b\u5834\u5408\u306f\u3053\u3061\u3089\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<h2><span id=\"i-3\">`\u3092\u4f7f\u3063\u305f\u30a4\u30f3\u30e9\u30a4\u30f3\u30b3\u30e1\u30f3\u30c8<\/span><\/h2>\n<pre><code>`# comment here`\n\nyuis on ASUS at \/mnt\/c\/pg$ echo this apple `# which is dark red` is pretty yummy.\nthis apple is pretty yummy.\n<\/code><\/pre>\n<p>\u9577\u3044\u4e00\u884c\u306e\u30b3\u30fc\u30c9\u306e\u9014\u4e2d\u3067\u30b3\u30e1\u30f3\u30c8\u3092\u633f\u5165\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u5834\u5408\u306f\u30a4\u30f3\u30e9\u30a4\u30f3\u30b3\u30e1\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30b5\u30d6\u30d7\u30ed\u30bb\u30b9\u3067\u52d5\u304b\u3057\u3066\u308b\u306e\u3067\u5c11\u3057\u8ca0\u62c5\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u4f7f\u3044\u65b9\u306b\u6c17\u3092\u3064\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u306a\u304a\u3001<code>\"$(# comment)\"<\/code>\u306f\u540c\u3058\u3088\u3046\u306b\u306f\u52d5\u304b\u306a\u3044\u306e\u3067\u6ce8\u610f\u3002<\/p>\n<hr>\n<p>\u5965\u304c\u6df1\u3044\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bash\u8a00\u8a9e\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u306e\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0\u306b\u304a\u3044\u3066\u3001\u30b3\u30e1\u30f3\u30c8\u306e\u65b9\u6cd5\u306b\u306f\u5b9f\u306b\u8272\u3005\u306a\u3084\u308a\u65b9\u304c\u3042\u308a\u307e\u3059\u3002\u4e00\u884c\u30b3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-pi","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1568"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1568"}],"version-history":[{"count":2,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1568\/revisions"}],"predecessor-version":[{"id":2900,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1568\/revisions\/2900"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}