{"id":26552,"date":"2022-12-16T00:49:35","date_gmt":"2023-10-09T08:00:57","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/"},"modified":"2025-08-11T21:53:40","modified_gmt":"2025-08-11T13:53:40","slug":"%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/","title":{"rendered":"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9"},"content":{"rendered":"<p>\u4f60\u597d\uff0c\u8fd9\u662f\u7b2c25\u5929\u7684\u5e16\u5b50\u3002<\/p>\n<p>\u6211\u60f3\u8981\u4eca\u5929\u7528\u7528\u7531Perl 6(nqp)\u7f16\u5199\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u9879\u76eespitsh\u73a9\u4e00\u4e0b\u3002<br \/>\nspitsh\u53ef\u4ee5\u7f16\u8bd1\u540d\u4e3a&#8221;Spook&#8221;\u7684\u8bed\u8a00\uff0c\u5e76\u8f93\u51fa\u4e0eshell\u811a\u672c\u517c\u5bb9\u7684\u547d\u4ee4\u3002\u8fd9\u4e2a\u7f16\u8bd1\u5668\u4f3c\u4e4e\u662f\u7528nqp\u7f16\u5199\u7684\u3002<\/p>\n<h1>\u5b89\u88c5Spitsh<\/h1>\n<p>\u6211\u4f1a\u4f7f\u7528ZEF\u3002<\/p>\n<pre class=\"post-pre\"><code>$ zef install Spit\r\n$ spit eval 'say \"hello world\"'\r\n<\/code><\/pre>\n<h1>\u5b89\u88c5Docker<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u79c1\u306e\u74b0\u5883\u306fDebian Stretch\u306a\u306e\u3067\u3001\u3053\u308c\u3092\u524d\u63d0\u306b\u9032\u3081\u3066\u3044\u304d\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>\u307e\u305a\u6b21\u306e\u30da\u30fc\u30b8\u306e\u624b\u9806\u306b\u5f93\u3063\u3066docker\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044:<\/p>\n<p>https:\/\/docs.docker.com\/engine\/installation\/linux\/docker-ce\/debian\/<\/p>\n<p>\u305d\u306e\u5f8c\u3001sudo\u3058\u3083\u306a\u304f\u3066\u3082\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306b\u6b21\u306e\u624b\u9806\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<p>https:\/\/docs.docker.com\/engine\/installation\/linux\/linux-postinstall\/<\/p>\n<p>3.\u306e\u30ed\u30b0\u30a2\u30a6\u30c8\uff06\u30ed\u30b0\u30a4\u30f3\u3092\u5fd8\u308c\u305a\u306b\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046 (\u81ea\u5206\u306f\u5fd8\u308c\u3066\u82e5\u5e72\u8a70\u307e\u308a\u307e\u3057\u305f)<\/p>\n<h1>\u6267\u884c\u5267\u60c5\uff08\u7684\u4e00\u90e8\u5206\uff09<\/h1>\n<p>\u5728CentOS\u73af\u5883\u4e2d\uff0c\u5982\u679c\u672a\u5b89\u88c5nc\u547d\u4ee4\uff0c\u5219\u751f\u6210\u7528\u4e8e\u6267\u884c\u6b64\u64cd\u4f5c\u7684Spook\u7a0b\u5e8f\u3002<\/p>\n<pre class=\"post-pre\"><code>$ spit eval --os=centos  '.install unless Pkg&lt;nc&gt;; ok Cmd&lt;nc&gt;,\"nc command exists now\"'\r\n<\/code><\/pre>\n<p>\u6267\u884c\u7ed3\u679c\uff1a<\/p>\n<pre class=\"post-pre\"><code>BEGIN(){\r\n  e(){ printf %s \"$1\"; }\r\n  exec 4&gt;\/dev\/null\r\n  installed(){ yum list installed \"$1\" &gt;&amp;4 2&gt;&amp;4; }\r\n  install(){ yum install -y $1 &gt;&amp;4 2&gt;&amp;4; }\r\n  exists(){ command -v \"$1\" &gt;&amp;4; }\r\n  exec 3&gt;&amp;1\r\n  say(){ printf '%s\\n' \"$1\" &gt;&amp;3; }\r\n  note(){ printf '%s\\n' \"$1\" &gt;&amp;2; }\r\n  die(){ note \"$1\" &amp;&amp; kill \"-TERM\" $$ &gt;&amp;4; }\r\n  ok(){ test \"$1\" &amp;&amp; say \"\u2714 - $2\" || die \"\u2718 - $2\"; }\r\n}\r\nMAIN(){\r\n  if ! installed nc; then\r\n    install nc\r\n  fi\r\n  ok \"$(exists nc &amp;&amp; e 1)\" 'nc command exists now'\r\n}\r\nBEGIN &amp;&amp; MAIN\r\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\uff0c\u8ba9\u6211\u4eec\u5c1d\u8bd5\u5728Docker\u4e2d\u8fd0\u884c\uff1a<\/p>\n<pre class=\"post-pre\"><code>$ spit eval --in-docker=centos '.install unless Pkg&lt;nc&gt;; ok Cmd&lt;nc&gt;,\"nc command exists now\"'\r\n<\/code><\/pre>\n<p>\u6267\u884c\u7ed3\u679c:<\/p>\n<pre class=\"post-pre\"><code>Unable to find image 'centos:latest' locally\r\nlatest: Pulling from library\/centos\r\n85432449fd0f: Pull complete \r\nDigest: sha256:3b1a65e9a05f0a77b5e8a698d3359459904c2a354dc3b25ae2e2f5c95f0b3667\r\nStatus: Downloaded newer image for centos:latest\r\nInstalling pacakges: nc\r\nwarning: \/var\/cache\/yum\/x86_64\/7\/base\/packages\/libpcap-1.5.3-9.el7.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID f4a80eb5: NOKEY\r\nImporting GPG key 0xF4A80EB5:\r\n Userid     : \"CentOS-7 Key (CentOS 7 Official Signing Key) &lt;security@centos.org&gt;\"\r\n Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5\r\n Package    : centos-release-7-4.1708.el7.centos.x86_64 (@CentOS)\r\n From       : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7\r\n\u2714 - nc command exists now\r\n<\/code><\/pre>\n<h1>\u6267\u884c\u975eSynopsis\u547d\u4ee4<\/h1>\n<p>\u5982\u679c\u4f60\u5bf9\u6b64\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u67e5\u770b\/doc\u76ee\u5f55\uff1ahttps:\/\/github.com\/spitsh\/spitsh\/tree\/master\/doc<\/p>\n<p>\u5c3d\u7ba1\u4f3c\u4e4e\u8fd8\u6709\u8bb8\u591a\u672a\u5b8c\u6210\u7684\u90e8\u5206\uff0c\u4f46\u6211\u4eec\u5bf9\u672a\u6765\u62b1\u6709\u671f\u5f85\u3002<\/p>\n<h1>\u6700\u540e<\/h1>\n<p>\u8c22\u8c22\u6240\u6709\u9605\u8bfb\u5230\u8fd9\u91cc\u7684\u8bfb\u8005\u4eec\uff0c2017\u5e74\u7684Perl 6\u5723\u8bde\u65e5\u5386\u5c31\u5230\u6b64\u7ed3\u675f\u4e86\u3002<br \/>\n\u540c\u65f6\u4e5f\u975e\u5e38\u611f\u8c22\u5728\u5fd9\u788c\u4e4b\u4e2d\u4e3a\u6211\u4eec\u64b0\u5199\u6295\u7a3f\u7684@AnaTofuZ\u548c@debility\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f60\u597d\uff0c\u8fd9\u662f\u7b2c25\u5929\u7684\u5e16\u5b50\u3002 \u6211\u60f3\u8981\u4eca\u5929\u7528\u7528\u7531Perl 6(nqp)\u7f16\u5199\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u9879\u76eespitsh\u73a9\u4e00\u4e0b\u3002 s [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-26552","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528\u5bff\u53f8spook-in-the-shell\u6765\u73a9\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528\u5bff\u53f8spook-in-the-shell\u6765\u73a9\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-09T08:00:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T13:53:40+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u96c5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u96c5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/\",\"name\":\"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-10-09T08:00:57+00:00\",\"dateModified\":\"2025-08-11T13:53:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\"},\"description\":\"\u5173\u4e8e\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\",\"name\":\"\u79d1, \u96c5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u96c5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528\u5bff\u53f8spook-in-the-shell\u6765\u73a9\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9","og_description":"\u5173\u4e8e\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528\u5bff\u53f8spook-in-the-shell\u6765\u73a9\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-09T08:00:57+00:00","article_modified_time":"2025-08-11T13:53:40+00:00","author":"\u79d1, \u96c5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u96c5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/","name":"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-10-09T08:00:57+00:00","dateModified":"2025-08-11T13:53:40+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a"},"description":"\u5173\u4e8e\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528\u5bff\u53f8(Spook in the Shell)\u6765\u73a9"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a","name":"\u79d1, \u96c5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","caption":"\u79d1, \u96c5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e5%af%bf%e5%8f%b8spook-in-the-shell%e6%9d%a5%e7%8e%a9\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/26552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=26552"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/26552\/revisions"}],"predecessor-version":[{"id":83333,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/26552\/revisions\/83333"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=26552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=26552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=26552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}