{"action":"created","issue":{"url":"https://api.github.com/repos/rmyorston/busybox-w32/issues/35","labels_url":"https://api.github.com/repos/rmyorston/busybox-w32/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/rmyorston/busybox-w32/issues/35/comments","events_url":"https://api.github.com/repos/rmyorston/busybox-w32/issues/35/events","html_url":"https://github.com/rmyorston/busybox-w32/issues/35","id":62525036,"number":35,"title":"Wildcard expansion","user":{"login":"ilg-ul","id":362732,"avatar_url":"https://avatars.githubusercontent.com/u/362732?v=3","gravatar_id":"","url":"https://api.github.com/users/ilg-ul","html_url":"https://github.com/ilg-ul","followers_url":"https://api.github.com/users/ilg-ul/followers","following_url":"https://api.github.com/users/ilg-ul/following{/other_user}","gists_url":"https://api.github.com/users/ilg-ul/gists{/gist_id}","starred_url":"https://api.github.com/users/ilg-ul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilg-ul/subscriptions","organizations_url":"https://api.github.com/users/ilg-ul/orgs","repos_url":"https://api.github.com/users/ilg-ul/repos","events_url":"https://api.github.com/users/ilg-ul/events{/privacy}","received_events_url":"https://api.github.com/users/ilg-ul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-17T21:44:41Z","updated_at":"2015-03-17T22:52:45Z","closed_at":null,"body":"I'm a bit confused about your comment in the home page:\r\n\r\n> ... the binaries provided here are configured with wildcard expansion disabled. This is the preferred option when the BusyBox shell is being used. (Unix-style shells expand wildcards on the command line before running programs ...\r\n\r\nI did some tests and apparently your shell did not expand wildcards, but after changing `CONFIG_NOGLOB=n` it did. Were the wildcard expanded by the shell, or by the utilities (I tried rm & ls from within sh).\r\n\r\nMy specific need for BusyBox is as shell for make, in the open-source [GNU ARM Eclipse plug-ins](http://gnuarmeclipse.livius.net/blog/) project. I build both make and busybox from sources, as documented in my [wiki](http://gnuarmeclipse.livius.net/wiki/How_to_cross_build_Windows_Build_Tools) page.\r\n\r\nThe make files generated by the plug-ins do not use wildcards, but in Eclipse it is also possible to build un-managed projects, using custom make files, where I need to support wildcard expansion, otherwise some builds written on GNU/Linux might fail.\r\n\r\nAny thoughts on the wildcard expansion?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rmyorston/busybox-w32/issues/comments/82631922","html_url":"https://github.com/rmyorston/busybox-w32/issues/35#issuecomment-82631922","issue_url":"https://api.github.com/repos/rmyorston/busybox-w32/issues/35","id":82631922,"user":{"login":"rmyorston","id":843671,"avatar_url":"https://avatars.githubusercontent.com/u/843671?v=3","gravatar_id":"","url":"https://api.github.com/users/rmyorston","html_url":"https://github.com/rmyorston","followers_url":"https://api.github.com/users/rmyorston/followers","following_url":"https://api.github.com/users/rmyorston/following{/other_user}","gists_url":"https://api.github.com/users/rmyorston/gists{/gist_id}","starred_url":"https://api.github.com/users/rmyorston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmyorston/subscriptions","organizations_url":"https://api.github.com/users/rmyorston/orgs","repos_url":"https://api.github.com/users/rmyorston/repos","events_url":"https://api.github.com/users/rmyorston/events{/privacy}","received_events_url":"https://api.github.com/users/rmyorston/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T22:52:45Z","updated_at":"2015-03-17T22:52:45Z","body":"Sorry you were confused by my note on wildcards.  The explanation on the web page is far too short.  If it's any consolation I'm equally confused by your claim that the shell in my binaries doesn't expand wildcards.\r\n\r\nLet me attempt a longer explanation.  Normally arguments to Windows command line programs are processed by the C runtime.  Wildcards on the command line are expanded according to Windows' rules regarding quoting and special characters.  In contrast, Unix shells perform wildcard expansion before the arguments are passed to the program.\r\n\r\nBusyBox on Windows is (obviously) a Windows command line program.  However, I only ever want to use it to run shell scripts or as an interactive shell interpreter, replacing the Windows command prompt.  In these cases wildcard expansion will always be performed by the shell:  there's no need for the binary to do it for us.  Thus I configure the executable with globbing turned off.\r\n\r\nOnce the BusyBox shell is running it performs its own wildcard expansions.  Starting from a Windows command prompt:\r\n\r\n```\r\nC:\\Users\\rmy>busybox sh\r\n$ touch 123a 123b\r\n$ ls\r\n123a 123b\r\n$ rm 123*\r\n$ ls\r\n$\r\n```\r\nIf you copy busybox.exe to rm.exe and try the same thing (having recreated the test files) you get:\r\n\r\n```\r\nC:\\Users\\rmy>rm 123*\r\nrm: can't remove '123*': No such file or directory\r\nC:\\Users\\rmy>\r\n```\r\n\r\nWhich shows that the rm.exe binary doesn't expand wildcards.\r\n\r\nNow, how this affects make on Windows I really don't know.  How does make know to use the BusyBox shell?"}}