{"id":303,"date":"2011-12-19T13:31:32","date_gmt":"2011-12-19T13:31:32","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=303"},"modified":"2011-12-19T13:31:32","modified_gmt":"2011-12-19T13:31:32","slug":"get-shell-command-return-status-return-code","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=303","title":{"rendered":"Get shell command return status \/ return code"},"content":{"rendered":"<p>Hello,<\/p>\n<p>for everyone who wanted to know how to get the return code or status from an executed command in unix:<\/p>\n<p><em># for example use the ls command on a directory<br \/>\n\tls -l \/home<\/em><\/p>\n<p><em># get return code<br \/>\n\techo $?<\/em><\/p>\n<p>This returns an integer code as 0 or 1 or 127. Normally 0 means OK, 1 means ERROR and 127 means COMMAND NOT FOUND. Every command has its own return code but the 3 mentionned before are general.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, for everyone who wanted to know how to get the return code or status from an executed command in unix: # for example use the ls command on a directory ls -l \/home # get return code echo $? This returns an integer code as 0 or 1 or 127. Normally 0 means OK, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,10],"tags":[],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-mac-osx"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/303\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}