{"id":6964,"date":"2016-09-15T16:16:28","date_gmt":"2016-09-15T14:16:28","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=6964"},"modified":"2016-09-15T16:16:28","modified_gmt":"2016-09-15T14:16:28","slug":"a-backticked-command-in-perl-resp-shell-what-about","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2016\/09\/15\/a-backticked-command-in-perl-resp-shell-what-about\/","title":{"rendered":"a backticked command in Perl resp. Shell\u00a0\u2013 what about $? ?"},"content":{"rendered":"<p>\t\t\t\tIn the Shell $? reflects the exit code of the previously executed command.<\/p>\n<pre>h=$(ls foo) # supposing there is neither a file nor a directory by that name\necho \"=$?=&gt;{$?}\"<\/pre>\n<p>In Perl $? reflects the exit code \u2026 as well:<\/p>\n<ul>\n<li><a href=\"http:\/\/perldoc.perl.org\/perlvar.html\">http:\/\/perldoc.perl.org\/perlvar.html<\/a>\u00a0: $CHILD_ERROR<\/li>\n<\/ul>\n<pre>$h = $(ls foo);\nprint \"=$?={$?}n\";<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In the Shell $? reflects the exit code of the previously executed command. h=$(ls foo) # supposing there is neither a file nor a directory by that name echo &#8220;=$?=&gt;{$?}&#8221; In Perl $? reflects the exit code \u2026 as well: http:\/\/perldoc.perl.org\/perlvar.html\u00a0: $CHILD_ERROR $h = $(ls foo); print &#8220;=$?={$?}n&#8221;;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-6964","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1Ok","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=6964"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6964\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=6964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=6964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=6964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}