{"id":5776,"date":"2020-07-31T13:40:48","date_gmt":"2020-07-31T04:40:48","guid":{"rendered":"https:\/\/www.fenet.jp\/infla\/column\/?p=5776"},"modified":"2021-10-14T17:56:06","modified_gmt":"2021-10-14T08:56:06","slug":"linux-string-substitution","status":"publish","type":"post","link":"https:\/\/www.fenet.jp\/infla\/column\/engineer\/linux-string-substitution\/","title":{"rendered":"\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u77e5\u3063\u3066\u304a\u304d\u305f\u3044Linux\u306e\u6587\u5b57\u5217\u7f6e\u63db\u306b\u3064\u3044\u3066\u3002bash\u3084sed\u306e\u66f8\u5f0f\u3092\u89e3\u8aac"},"content":{"rendered":"<div class=\"vcofp624bb66f2cef8\" ><!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-04abd3c8-8f3b-4c56-8d11-1804732a9998\"><span class=\"hs-cta-node hs-cta-04abd3c8-8f3b-4c56-8d11-1804732a9998\" id=\"hs-cta-04abd3c8-8f3b-4c56-8d11-1804732a9998\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/20723875\/04abd3c8-8f3b-4c56-8d11-1804732a9998\" target=\"_blank\" rel=\"noopener\"><img class=\"hs-cta-img\" id=\"hs-cta-img-04abd3c8-8f3b-4c56-8d11-1804732a9998\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/20723875\/04abd3c8-8f3b-4c56-8d11-1804732a9998.png\"  alt=\"\u57fa\u672c\u60c5\u5831\u6280\u8853\u8005\u8a66\u9a13\u306e\u8a66\u9a13\u5bfe\u7b56\u306f\u3053\u3061\u3089>>\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(20723875, '04abd3c8-8f3b-4c56-8d11-1804732a9998', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.vcofp624bb66f2cef8 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.vcofp624bb66f2cef8 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.vcofp624bb66f2cef8 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.vcofp624bb66f2cef8 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.vcofp624bb66f2cef8 {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n<div class=\"zmigp624bb66f2cebb\" ><!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-7a78b0b1-92d6-4b3e-80cf-58e8796e7a76\"><span class=\"hs-cta-node hs-cta-7a78b0b1-92d6-4b3e-80cf-58e8796e7a76\" id=\"hs-cta-7a78b0b1-92d6-4b3e-80cf-58e8796e7a76\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/20723875\/7a78b0b1-92d6-4b3e-80cf-58e8796e7a76\" ><img class=\"hs-cta-img\" id=\"hs-cta-img-7a78b0b1-92d6-4b3e-80cf-58e8796e7a76\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/20723875\/7a78b0b1-92d6-4b3e-80cf-58e8796e7a76.png\"  alt=\"\u6700\u65b0\u60c5\u5831\u3084\u95a2\u5fc3\u306e\u3042\u308b\u60c5\u5831\u3092\u6bce\u65e5\u304a\u5c4a\u3051\u3002  FEnet\u30a4\u30f3\u30d5\u30e9\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3    \u30e1\u30eb\u30de\u30ac\u767b\u9332\u306f\u3053\u3061\u3089\u304b\u3089>>\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(20723875, '7a78b0b1-92d6-4b3e-80cf-58e8796e7a76', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.zmigp624bb66f2cebb {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.zmigp624bb66f2cebb {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.zmigp624bb66f2cebb {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.zmigp624bb66f2cebb {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.zmigp624bb66f2cebb {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n<p>Linux\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3084\u30b5\u30fc\u30d0\u69cb\u7bc9\u3001\u7d44\u307f\u8fbc\u307f\u30b7\u30b9\u30c6\u30e0\u306e\u958b\u767a\u306a\u3069\u3001\u69d8\u3005\u306a\u7528\u9014\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u4ed5\u4e8b\u306bLinux\u306e\u30b9\u30ad\u30eb\u304c\u6c42\u3081\u3089\u308c\u308b\u3053\u3068\u3082\u591a\u304f\u3001Linux\u3092\u5b66\u3076\u3053\u3068\u3067\u4ed5\u4e8b\u306e\u5e45\u304c\u5e83\u304c\u308b\u3068\u3044\u3048\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u30a8\u30f3\u30b8\u30cb\u30a2\u306a\u3089\u77e5\u3063\u3066\u304a\u304d\u305f\u3044Linux\u306e\u6587\u5b57\u5217\u7f6e\u63db\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u307e\u3057\u305f\u3002<br \/>\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-0f72735d-da9f-4038-a47b-134730f22cb0\"><span class=\"hs-cta-node hs-cta-0f72735d-da9f-4038-a47b-134730f22cb0\" id=\"hs-cta-0f72735d-da9f-4038-a47b-134730f22cb0\"><!--[if lte IE 8]>\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/20723875\/0f72735d-da9f-4038-a47b-134730f22cb0\" ><img class=\"hs-cta-img\" id=\"hs-cta-img-0f72735d-da9f-4038-a47b-134730f22cb0\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/20723875\/0f72735d-da9f-4038-a47b-134730f22cb0.png\"  alt=\"Linux\u30a8\u30f3\u30b8\u30cb\u30a2 \u6848\u4ef6\u30fb\u6c42\u4eba\u4e00\u89a7\u306f\u3053\u3061\u3089\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(20723875, '0f72735d-da9f-4038-a47b-134730f22cb0', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u3053\u306e\u8a18\u4e8b\u3067\u308f\u304b\u308b\u3053\u3068<\/p><ul class=\"toc_list\"><li><a href=\"#Linux\"><span class=\"toc_number toc_depth_1\">1<\/span> Linux\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3088\u308b\u7f6e\u63db\u3068\u306f<\/a><\/li><li><a href=\"#Linuxbash\"><span class=\"toc_number toc_depth_1\">2<\/span> Linux\u306ebash\u7f6e\u63db\u306b\u3064\u3044\u3066<\/a><\/li><li><a href=\"#Linuxsed\"><span class=\"toc_number toc_depth_1\">3<\/span> Linux\u306esed\u7f6e\u63db\u306b\u3064\u3044\u3066<\/a><\/li><li><a href=\"#Linux-2\"><span class=\"toc_number toc_depth_1\">4<\/span> Linux\u3092\u5b66\u3093\u3067\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u306e\u5e02\u5834\u4fa1\u5024\u30a2\u30c3\u30d7\u3092\u76ee\u6307\u305d\u3046<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Linux\">Linux\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3088\u308b\u7f6e\u63db\u3068\u306f<\/span><\/h2>\n<p>Linux\u306f\u3001\u6838\u3068\u306a\u308b\u300c\u30ab\u30fc\u30cd\u30eb\u300d\u3068\u6bbb\u306b\u3042\u305f\u308b\u300c\u30b7\u30a7\u30eb\u300d\u306e2\u3064\u304b\u3089\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u306e\u5f79\u5272\u306fLinux\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3068\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u3067\u3001\u30ab\u30fc\u30cd\u30eb\u304c\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u91c8\u3057\u3066\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u30b3\u30de\u30f3\u30c9\u3092\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u5316\u3057\u305f\u3082\u306e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e1\u3064\u3060\u3068\u3044\u3048\u307e\u3059\u3002<br \/>\n\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u30c6\u30ad\u30b9\u30c8\u3067\u66f8\u304b\u308c\u3066\u3044\u308b\u305f\u3081\u6c4e\u7528\u6027\u304c\u9ad8\u304f\u3001\u540c\u3058\u30b7\u30a7\u30eb\u3068\u30b3\u30de\u30f3\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u74b0\u5883\u3067\u3042\u308c\u3070\u3069\u3053\u3067\u3082\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u307e\u3068\u3081\u3066\u51e6\u7406\u3057\u305f\u3044\u3068\u304d\u306b\u4fbf\u5229\u306a\u306e\u304c\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3088\u308b\u7f6e\u63db\u3067\u3059\u3002<br \/>\n\u7f6e\u63db\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u3042\u308b\u6587\u5b57\u5217\u3092\u9055\u3046\u6587\u5b57\u5217\u306b\u4e00\u62ec\u3067\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2><span id=\"Linuxbash\">Linux\u306ebash\u7f6e\u63db\u306b\u3064\u3044\u3066<\/span><\/h2>\n<p><img loading=\"lazy\" class=\"aligncenter size-large wp-image-2300\" src=\"https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/269top-1024x683.jpg\" alt=\"Linux\u306ebash\u7f6e\u63db\" width=\"640\" height=\"427\" srcset=\"https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/269top-1024x683.jpg 1024w, https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/269top-300x200.jpg 300w, https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/269top-768x512.jpg 768w, https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/269top.jpg 2000w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Linux\u3067\u73fe\u5728\u6700\u3082\u4e00\u822c\u7684\u306a\u30b7\u30a7\u30eb\u304c\u300cbash\u300d\u3067\u3059\u3002<br \/>\n\u5909\u6570\u5024\u306e\u7f6e\u63db\u306e\u66f8\u5f0f\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>${\u5909\u6570\u540d#\u30d1\u30bf\u30fc\u30f3}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u524d\u65b9\u304b\u3089\u691c\u7d22\u3057\u3001\u4e00\u756a\u521d\u3081\u306b\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>${\u5909\u6570\u540d##\u30d1\u30bf\u30fc\u30f3}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u524d\u65b9\u304b\u3089\u691c\u7d22\u3057\u3001\u4e00\u756a\u5f8c\u308d\u307e\u3067\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>${\u5909\u6570\u540d%\u30d1\u30bf\u30fc\u30f3}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5f8c\u65b9\u304b\u3089\u691c\u7d22\u3057\u3001\u4e00\u756a\u521d\u3081\u306b\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>${\u5909\u6570\u540d%%\u30d1\u30bf\u30fc\u30f3}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5f8c\u65b9\u304b\u3089\u691c\u7d22\u3057\u3001\u4e00\u756a\u5f8c\u308d\u307e\u3067\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>${\u5909\u6570\u540d\/\u30d1\u30bf\u30fc\u30f3\/\u6587\u5b57\u5217}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6700\u521d\u306b\u4e00\u81f4\u3057\u305f\u3082\u306e\u306e\u307f\u3001\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>${\u5909\u6570\u540d\/\/\u30d1\u30bf\u30fc\u30f3\/\u6587\u5b57\u5217}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5168\u3066\u306e\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n<p>bash\u7f6e\u63db\u3092\u884c\u3046\u969b\u306b\u306f\u4ee5\u4e0b\u306e\u8868\u73fe\u3082\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>*\uff08\u30a2\u30b9\u30bf\u30ea\u30b9\u30af\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u9577\u3055\u304c0\u4ee5\u4e0a\u306e\u6587\u5b57\u5217\u306b\u4e00\u81f4\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>?\uff08\u30af\u30a8\u30b9\u30c1\u30e7\u30f3\u30de\u30fc\u30af\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4efb\u610f\u306e\u6587\u5b57\u306b\u4e00\u81f4\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>[\u6587\u5b57]\uff08\u89d2\u304b\u3063\u3053\u3067\u62ec\u3089\u308c\u305f\u6587\u5b57\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u62ec\u3089\u308c\u305f\u6587\u5b57\u306e\u3044\u305a\u308c\u304b\u306b\u4e00\u81f4\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>[^\u6587\u5b57] \u307e\u305f\u306f[!\u6587\u5b57] \uff08\u89d2\u304b\u3063\u3053\u3067\u62ec\u3089\u308c\u3066\u304a\u308a\u3001\u524d\u306b^\u307e\u305f\u306f!\u304c\u3042\u308b\u6587\u5b57\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u62ec\u3089\u308c\u305f\u6587\u5b57\u4ee5\u5916\u306e\u6587\u5b57\u306e\u3044\u305a\u308c\u304b\u306b\u4e00\u81f4\u3057\u307e\u3059\u3002<\/p>\n<h2><span id=\"Linuxsed\">Linux\u306esed\u7f6e\u63db\u306b\u3064\u3044\u3066<\/span><\/h2>\n<p><img loading=\"lazy\" class=\"aligncenter size-large wp-image-2217\" src=\"https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/laptop-3190194_1920-1-1024x683.jpg\" alt=\"Linux\u306esed\u7f6e\u63db\" width=\"640\" height=\"427\" srcset=\"https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/laptop-3190194_1920-1-1024x683.jpg 1024w, https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/laptop-3190194_1920-1-300x200.jpg 300w, https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/laptop-3190194_1920-1-768x512.jpg 768w, https:\/\/www.fenet.jp\/infla\/column\/wp-content\/uploads\/2019\/07\/laptop-3190194_1920-1.jpg 1920w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>sed\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u5909\u63db\u306a\u3069\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u306b\u304a\u3044\u3066\u4f7f\u7528\u3055\u308c\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<br \/>\nLinux\u306esed\u7f6e\u63db\u3092\u884c\u3046\u969b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u66f8\u5f0f\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n\u300c$ sed s \/ \u7f6e\u63db\u5bfe\u8c61\u6587\u5b57\u5217 \/ \u7f6e\u63db\u5f8c\u6587\u5b57\u5217 \/ \u30d5\u30a1\u30a4\u30eb\u540d\u300d<\/p>\n<p>sed\u7f6e\u63db\u3092\u884c\u3046\u969b\u306b\u4f7f\u7528\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3057\u3066\u306f\u3001\u4e3b\u306b\u4ee5\u4e0b\u306e3\u3064\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>-e<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6307\u5b9a\u3057\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u7f6e\u63db\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>-f\u30d5\u30a1\u30a4\u30eb<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u5185\u5bb9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>-r<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>sed\u7f6e\u63db\u306e\u66f8\u5f0f\u306e\u5177\u4f53\u4f8b\u3068\u3057\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>$ sed -e &#8216;s\/\u5909\u66f4\u524d\u306e\u6587\u5b57\u5217\/\u5909\u66f4\u5f8c\u306e\u6587\u5b57\u5217\/g&#8217; .\/data.txt &gt; .\/data-new.txt<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6587\u5b57\u5217\u3092\u4e00\u62ec\u3067\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>$ sed -e &#8216;s\/\u5909\u66f4\u524d\u306e\u6587\u5b57\u5217\/\/g&#8217; .\/data.txt &gt; .\/data-new.txt<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6587\u5b57\u5217\u3092\u4e00\u62ec\u3067\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>$ sed -e &#8216;\/\u30d1\u30bf\u30fc\u30f3\/d&#8217; .\/data.txt &gt; .\/data-new.txt<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u305f\u884c\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>$ sed -e \u20182,4d\u2019 data.txt&gt; .\/data-new.txt<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>2\u884c\u76ee\u304b\u30894\u884c\u76ee\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>$ cat data.txt | sed -e \u20182,4d\u2019 &gt; .\/data-new.txt<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u3092\u4f7f\u3063\u305f\u53d7\u3051\u53d6\u308a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>$ sed -i -e &#8216;s\/\u5909\u66f4\u524d\u306e\u6587\u5b57\u5217\/\u5909\u66f4\u5f8c\u306e\u6587\u5b57\u5217\/g&#8217; .\/data.txt<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5143\u30c6\u30ad\u30b9\u30c8\u3092\u76f4\u63a5\u7de8\u96c6\u30fb\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306fGNU\u306e\u307f\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h2><span id=\"Linux-2\">Linux\u3092\u5b66\u3093\u3067\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u306e\u5e02\u5834\u4fa1\u5024\u30a2\u30c3\u30d7\u3092\u76ee\u6307\u305d\u3046<\/span><\/h2>\n<p>\u30a8\u30f3\u30b8\u30cb\u30a2\u306a\u3089\u3001Linux\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3084bash\u7f6e\u63db\u3001sed\u7f6e\u63db\u306a\u3069\u306f\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002<br \/>\n\u6587\u5b57\u5217\u7f6e\u63db\u3092\u899a\u3048\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u624b\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u3092\u4e00\u6c17\u306b\u7d42\u308f\u3089\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305c\u3072Linux\u3092\u5b66\u3093\u3067\u3001\u30ec\u30d9\u30eb\u306e\u9ad8\u3044\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><a href=\"https:\/\/www.fenet.jp\/infla\/\">\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u6848\u4ef6\u3092\u63a2\u3059\u306a\u3089FEnet\u30a4\u30f3\u30d5\u30e9<\/a><\/p>\n<p><!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-b1ad6e73-f508-4348-842e-0d8cb58ee6e6\"><span class=\"hs-cta-node hs-cta-b1ad6e73-f508-4348-842e-0d8cb58ee6e6\" id=\"hs-cta-b1ad6e73-f508-4348-842e-0d8cb58ee6e6\"><!--[if lte IE 8]>\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/20723875\/b1ad6e73-f508-4348-842e-0d8cb58ee6e6\" ><img class=\"hs-cta-img\" id=\"hs-cta-img-b1ad6e73-f508-4348-842e-0d8cb58ee6e6\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/20723875\/b1ad6e73-f508-4348-842e-0d8cb58ee6e6.png\"  alt=\"Linux\u30a8\u30f3\u30b8\u30cb\u30a2 \u6848\u4ef6\u30fb\u6c42\u4eba\u4e00\u89a7\u306f\u3053\u3061\u3089\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(20723875, 'b1ad6e73-f508-4348-842e-0d8cb58ee6e6', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3084\u30b5\u30fc\u30d0\u69cb\u7bc9\u3001\u7d44\u307f\u8fbc\u307f\u30b7\u30b9\u30c6\u30e0\u306e\u958b\u767a\u306a\u3069\u3001\u69d8\u3005\u306a\u7528\u9014\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u4ed5\u4e8b\u306bLinux\u306e\u30b9\u30ad\u30eb\u304c\u6c42\u3081\u3089\u308c\u308b\u3053\u3068\u3082\u591a\u304f\u3001Linux\u3092\u5b66\u3076\u3053\u3068\u3067\u4ed5\u4e8b\u306e\u5e45\u304c\u5e83\u304c\u308b\u3068\u3044\u3048\u308b\u3067\u3057\u3087<a class=\"read-more\" href=\"https:\/\/www.fenet.jp\/infla\/column\/engineer\/linux-string-substitution\/\"> &#8230;\u3082\u3063\u3068\u8aad\u3080<\/a><\/p>\n","protected":false},"author":7,"featured_media":5794,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[101],"tags":[27],"_links":{"self":[{"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/posts\/5776"}],"collection":[{"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/comments?post=5776"}],"version-history":[{"count":8,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/posts\/5776\/revisions"}],"predecessor-version":[{"id":9242,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/posts\/5776\/revisions\/9242"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/media\/5794"}],"wp:attachment":[{"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/media?parent=5776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/categories?post=5776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fenet.jp\/infla\/column\/wp-json\/wp\/v2\/tags?post=5776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}