{"id":35463,"date":"2022-04-05T14:59:42","date_gmt":"2022-04-05T18:59:42","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=35463"},"modified":"2022-04-13T19:31:19","modified_gmt":"2022-04-13T23:31:19","slug":"using-shellcheck-with-bbedit","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/04\/05\/using-shellcheck-with-bbedit\/","title":{"rendered":"Using shellcheck With BBEdit"},"content":{"rendered":"<p><a href=\"https:\/\/scriptingosx.com\/2022\/04\/use-shellcheck-with-bbedit\/\">Armin Briegel<\/a>:<\/p>\n<blockquote cite=\"https:\/\/scriptingosx.com\/2022\/04\/use-shellcheck-with-bbedit\/\">\n<p>Once you have the shellcheck command installed, you can also invoke from within BBEdit: When you have a script open in BBEdit, verify that the script is recognized as a &lsquo;Unix shell script.&rsquo; Then you can select &lsquo;Check Syntax&#8230;&rsquo; from the &lsquo;#!&rsquo; menu (keyboard shortcut &#x2318;-K). This will open a second window with all the issues shellcheck has found.<\/p>\n<\/blockquote>\n<p>Unfortunately, given that Apple is phasing out <code>bash<\/code>, it doesn&rsquo;t work with <code>zsh<\/code>.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/06\/04\/macos-10-15-switches-from-bash-to-zsh\/\">macOS 10.15 Switches From bash to zsh<\/a><\/li>\n<\/ul>\n\n<p id=\"using-shellcheck-with-bbedit-update-2022-04-13\">Update (2022-04-13): <a href=\"https:\/\/twitter.com\/gingerbeardman\/status\/1511451668050817040\">Matt Sephton<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/gingerbeardman\/status\/1511451668050817040\">\n<p><code>zsh -n $FILENAME<\/code> and\/or <code>zsh -x $FILENAME<\/code> (non_exec and debug mode respectively) are a reasonable workaround. Not shellcheck good but workable.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Armin Briegel: Once you have the shellcheck command installed, you can also invoke from within BBEdit: When you have a script open in BBEdit, verify that the script is recognized as a &lsquo;Unix shell script.&rsquo; Then you can select &lsquo;Check Syntax&#8230;&rsquo; from the &lsquo;#!&rsquo; menu (keyboard shortcut &#x2318;-K). This will open a second window with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-04-05T18:59:46Z","apple_news_api_id":"bd03007c-5d40-456e-bc53-5e515b326a72","apple_news_api_modified_at":"2022-04-13T23:31:21Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AvQMAfF1ARW68U15RWzJqcg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[767,154,30,32,2077,71,163,1817],"class_list":["post-35463","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bash","tag-bbedit","tag-mac","tag-macapp","tag-macos-12","tag-programming","tag-unix","tag-zsh"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=35463"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35463\/revisions"}],"predecessor-version":[{"id":35564,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35463\/revisions\/35564"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=35463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=35463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=35463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}