{"id":7152,"date":"2017-01-17T16:42:52","date_gmt":"2017-01-17T15:42:52","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=7152"},"modified":"2017-01-17T16:42:52","modified_gmt":"2017-01-17T15:42:52","slug":"busybox-w32-shell-command-completion","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2017\/01\/17\/busybox-w32-shell-command-completion\/","title":{"rendered":"shell command completion with busybox-w32 resp. its &#8220;ash&#8221;"},"content":{"rendered":"<p>\t\t\t\tWith Bash command completion works the way, I expect it \u2013 or through all the years with Bash I learned what to expect: If I try to complete through a relativ or absolute directory, it lets me complete (sub)directory names and names of executable files.<\/p>\n<p>With ash (under busybox-32) initially I had trouble getting certain executables recognised by command completion. It turned out, I only had trouble with shell scripts. And that was because my shell scripts did\u00a0not have a shebang line:<\/p>\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Shebang_(Unix)\">https:\/\/en.wikipedia.org\/wiki\/Shebang_(Unix)<\/a><\/li>\n<\/ul>\n<p>That&#8217;s because I &#8220;always&#8221; want to get them run through THE STANDARD system shell, and this is being achieved through not using a shebang line \u2013 so (under &#8220;normal&#8221; circumstances) why should I let them have a shebang line?<\/p>\n<p>On busybox-w32 shell scripts w\/o shebang line get properly executed \u2013 but they are not considered for command completion.<\/p>\n<p>That&#8217;s a phenomenon resp. approach I had never come across before. And because I could not guess it by myself\u00a0(and I falsely assumed the &#8220;ash&#8221; would consider the file extension), I created an &#8220;issue&#8221; here:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/rmyorston\/busybox-w32\">https:\/\/github.com\/rmyorston\/busybox-w32<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/rmyorston\/busybox-w32\/issues\/68\">https:\/\/github.com\/rmyorston\/busybox-w32\/issues\/68<\/a>\u00a0: &#8220;command completion&#8221;<\/li>\n<\/ul>\n<p>The reply:<\/p>\n<blockquote><p>In this context the file extension doesn&#8217;t matter. A text file is considered to be executable if the first characters are &#8220;<span style=\"text-decoration: underline\">#!<\/span>&#8220;.<\/p><\/blockquote>\n<p>And it works exactly as described.<\/p>\n<p>On Windows there is not &#8220;executable bit&#8221;, as on Unix\/Linux\/\u2026 filesystems. So busybox-w32 (or BusyBox in general?!?) looks at the &#8220;shebang&#8221;, and if there is one, the file is considered for command completion.\t\t\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Bash command completion works the way, I expect it \u2013 or through all the years with Bash I learned what to expect: If I try to complete through a relativ or absolute directory, it lets me complete (sub)directory names and names of executable files. With ash (under busybox-32) initially I had trouble getting certain [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-7152","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-1Rm","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/7152","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=7152"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/7152\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=7152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=7152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=7152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}