{"id":988,"date":"2022-08-30T15:10:31","date_gmt":"2022-08-30T15:10:31","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/how-can-i-get-the-error-code-exit-code-of-xdg-mime-query-filetype-command-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:10:31","modified_gmt":"2022-08-30T15:10:31","slug":"how-can-i-get-the-error-code-exit-code-of-xdg-mime-query-filetype-command-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-can-i-get-the-error-code-exit-code-of-xdg-mime-query-filetype-command-collection-of-common-programming-errors\/","title":{"rendered":"How can I get the error code (exit code) of &ldquo;xdg-mime query filetype&rdquo; command?-Collection of common programming errors"},"content":{"rendered":"<p>In Bourne-derived shells (<code>sh<\/code>, <code>ash<\/code>, <code>bash<\/code>, <code>dash<\/code>, <code>zsh<\/code>&#8230;) the exit code of the last-run program is in the <code>$?<\/code> variable:<\/p>\n<pre><code>$ ls \/no-such-file\nls: \/no-such-file: No such file or directory\n$ echo $?\n2\n<\/code><\/pre>\n<p>So in this case, the exit code of <code>ls<\/code> is 2.<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:11:31. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>In Bourne-derived shells (sh, ash, bash, dash, zsh&#8230;) the exit code of the last-run program is in the $? variable: $ ls \/no-such-file ls: \/no-such-file: No such file or directory $ echo $? 2 So in this case, the exit code of ls is 2. Originally posted 2013-11-09 23:11:31.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-988","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=988"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/988\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}