{"id":339,"date":"2012-07-11T04:40:12","date_gmt":"2012-07-10T19:40:12","guid":{"rendered":"http:\/\/litcoder.cafe24.com\/?p=339"},"modified":"2012-07-11T04:40:12","modified_gmt":"2012-07-10T19:40:12","slug":"tip-hex-string%ec%9d%84-bash%ec%97%90%ec%84%9c-%eb%b3%b4%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/litcoder.com\/?p=339","title":{"rendered":"[Tip] Hex string\uc744 bash\uc5d0\uc11c \ubcf4\uae30"},"content":{"rendered":"<p>Unix command\uc778 echo\ub97c -e option\uacfc \ud568\uaed8\uc4f0\uba74 &#8216;\\x&#8217;\ub85c escape\ub41c hex\uac12\uc744 \ubb38\uc790\ub85c \ubcf4\uc5ec \uc900\ub2e4.<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">$ echo -e \"\\x5B\\xEB\\xAC\\xBC\\xEB\\x86\\x80\\xEC\\x9D\\xB4\\x20\\xEA\\xB7\\xB8\\xEB\\xA6\\xBC\\xED\\x8C\\x90\\x5D\"\n[\ubb3c\ub180\uc774 \uadf8\ub9bc\ud310]<\/pre>\n<p>Web browser\ub4f1\uc5d0\uc11c\ub294 &#8216;\\x&#8217;\uac00 \uc544\ub2cc &#8216;%&#8217;\ub97c escape character\ub85c \uc0ac\uc6a9\ud558\uae30\ub3c4 \ud558\ub294\ub370 \uc774\ub7f0\uacbd\uc6b0\ub294 bash\uc758 string \uce58\ud658\uc744 \uc0ac\uc6a9\ud574\uc11c &#8216;\\x&#8217;\ub85c \ubcc0\ud658\ud574\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">$ str='\\x5B\\xEB\\xAC\\xBC\\xEB\\x86\\x80\\xEC\\x9D\\xB4\\x20\\xEA\\xB7\\xB8\\xEB\\xA6\\xBC\\xED\\x8C\\x90\\x5D'\n\n$ echo -e ${str\/\/%\/\\\\x}\n[\ubb3c\ub180\uc774 \uadf8\ub9bc\ud310]<\/pre>\n<p>* Bash\uc5d0\uc11c string\uc744 \ub2e4\ub8e8\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574\uc11c\ub294 <a href=\"http:\/\/wiki.kldp.org\/HOWTO\/html\/Adv-Bash-Scr-HOWTO\/string-manipulation.html\" target=\"_blank\" rel=\"noopener noreferrer\">KLDP\uc758 \uc774 \ubb38\uc11c<\/a>\ub97c \ucc38\uace0.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unix command\uc778 echo\ub97c -e option\uacfc \ud568\uaed8\uc4f0\uba74 &#8216;\\x&#8217;\ub85c escape\ub41c hex\uac12\uc744 \ubb38\uc790\ub85c \ubcf4\uc5ec \uc900\ub2e4. $ echo -e &#8220;\\x5B\\xEB\\xAC\\xBC\\xEB\\x86\\x80\\xEC\\x9D\\xB4\\x20\\xEA\\xB7\\xB8\\xEB\\xA6\\xBC\\xED\\x8C\\x90\\x5D&#8221; [\ubb3c\ub180\uc774 \uadf8\ub9bc\ud310] Web browser\ub4f1\uc5d0\uc11c\ub294 &#8216;\\x&#8217;\uac00 \uc544\ub2cc &#8216;%&#8217;\ub97c escape character\ub85c \uc0ac\uc6a9\ud558\uae30\ub3c4 \ud558\ub294\ub370 \uc774\ub7f0\uacbd\uc6b0\ub294 bash\uc758 string \uce58\ud658\uc744 \uc0ac\uc6a9\ud574\uc11c &#8216;\\x&#8217;\ub85c \ubcc0\ud658\ud574\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. $ str=&#8217;\\x5B\\xEB\\xAC\\xBC\\xEB\\x86\\x80\\xEC\\x9D\\xB4\\x20\\xEA\\xB7\\xB8\\xEB\\xA6\\xBC\\xED\\x8C\\x90\\x5D&#8217; $ echo -e ${str\/\/%\/\\\\x} [\ubb3c\ub180\uc774 \uadf8\ub9bc\ud310] * Bash\uc5d0\uc11c string\uc744 \ub2e4\ub8e8\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574\uc11c\ub294 KLDP\uc758 \uc774 \ubb38\uc11c\ub97c \ucc38\uace0.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[20,125],"class_list":["post-339","post","type-post","status-publish","format-standard","hentry","category-linux","tag-bash","tag-tip"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts\/339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339"}],"version-history":[{"count":0,"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts\/339\/revisions"}],"wp:attachment":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}