{"id":1828,"date":"2019-07-05T19:12:27","date_gmt":"2019-07-05T10:12:27","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=1828"},"modified":"2021-07-19T18:12:30","modified_gmt":"2021-07-19T09:12:30","slug":"bash-%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%81%8c%e7%b5%82%e4%ba%86%e3%81%97%e3%81%9f%e3%82%89telegram%e7%b5%8c%e7%94%b1%e3%81%a7%e3%83%87%e3%82%b9%e3%82%af%e3%83%88%e3%83%83%e3%83%97%e3%81%ab","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=1828","title":{"rendered":"Bash \u30b3\u30de\u30f3\u30c9\u304c\u7d42\u4e86\u3057\u305f\u3089telegram\u7d4c\u7531\u3067\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306b\u901a\u77e5\u3059\u308b"},"content":{"rendered":"<p>Linux\u30d1\u30bd\u30b3\u30f3\u30fb\u30b5\u30fc\u30d0\u30fc\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3084WSL\u306b\u304a\u3044\u3066\u3001Bash\u30b3\u30de\u30f3\u30c9\u304c\u7d42\u4e86\u3057\u305f\u3089telegram\u7d4c\u7531\u3067\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306b\u901a\u77e5\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n\u30d0\u30c3\u30b0\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3057\u3066\u7d42\u4e86\u3057\u305f\u3089\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u901a\u77e5\u3057\u3066\u307b\u3057\u3044\u306a\u3068\u601d\u3063\u3066\u3044\u3066\u3001\u50d5\u306f\u666e\u6bb5Windows\u306e\u901a\u77e5 &#8211; chrome\u3068\u304b\u305d\u306e\u4ed6\u30a2\u30d7\u30ea\u304b\u3089\u6765\u308b\u4e00\u822c\u7684\u306a\u901a\u77e5 &#8211; \u306f\u5168\u90e8\u30aa\u30d5\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3001telegram\u3092\u901a\u3057\u3066\u901a\u77e5\u3092\u3055\u305b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>telegram\u3092\u901a\u3055\u306a\u3044\u3067\u901a\u77e5\u3092\u3059\u308b\u5834\u5408\u306f\u3001powershell\u304bJava\u304bC#\u3042\u305f\u308a\u3067\u30d0\u30eb\u30fc\u30f3\u901a\u77e5\u306e\u65b9\u6cd5\u3092\u30b0\u30b0\u3063\u3066\u9802\u3051\u308c\u3070\u65e9\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><code>\npush(){\n  command=\"$@\"\n  eval \" ${command} ; errorCode=\\$? \" ; telegram-sendMessage \"Command finished: ${command} \/ ErrorCode: ${errorCode}\" &gt;&amp;\/dev\/null\n}\n\n<\/code><\/pre>\n<p><a href=\"https:\/\/yuis-programming.com\/?p=1241\">Telegram API\u3067Ubuntu Bash\u304b\u3089curl\u30b3\u30de\u30f3\u30c9\u3067Telegram\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b<\/a><\/p>\n<pre><code>telegram-sendMessage(){\n  curl -s -X POST \"https:\/\/api.telegram.org\/${TELEGRAM_API_KEY}\/sendMessage\" -d chat_id=638365737 -d text=\"${1:-Hello World}\"\n}\n\n<\/code><\/pre>\n<h2>\u4f7f\u7528\u4f8b<\/h2>\n<pre><code>push sleep 3 ; echo hoge\n<\/code><\/pre>\n<p><img src=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_11ccca5d-615b-403a-96e1-4e426e1cd2c5.png\" alt=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_11ccca5d-615b-403a-96e1-4e426e1cd2c5.png\"><\/p>\n<pre><code>push \"sleep 3 ; echo hoge\"\n<\/code><\/pre>\n<p><img src=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_72dd3a06-798a-4538-8120-b7ae6b12eefc.png\" alt=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_72dd3a06-798a-4538-8120-b7ae6b12eefc.png\"><\/p>\n<pre><code>push sleep 3 &amp;\n<\/code><\/pre>\n<p><img src=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_a2766f70-e350-42b2-aac0-8baba43bb096.png\" alt=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_a2766f70-e350-42b2-aac0-8baba43bb096.png\"><\/p>\n<pre><code>push undefinedfunc\n<\/code><\/pre>\n<p><img src=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_9a673841-9328-46ae-8dc7-8da206ae2de2.png\" alt=\"https:\/\/yuis.xsrv.jp\/images\/ss\/ShareX_ScreenShot_9a673841-9328-46ae-8dc7-8da206ae2de2.png\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u30d1\u30bd\u30b3\u30f3\u30fb\u30b5\u30fc\u30d0\u30fc\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3084WSL\u306b\u304a\u3044\u3066\u3001Bash\u30b3\u30de\u30f3\u30c9\u304c\u7d42\u4e86\u3057\u305f\u3089telegram\u7d4c\u7531 [&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-tu","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1828"}],"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=1828"}],"version-history":[{"count":2,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1828\/revisions"}],"predecessor-version":[{"id":2694,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1828\/revisions\/2694"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}