Title: Need syntax or cmdlet for globbing with space (i.e. glue quoted literals with globs) · Issue #13098 · PowerShell/PowerShell · GitHub
Open Graph Title: Need syntax or cmdlet for globbing with space (i.e. glue quoted literals with globs) · Issue #13098 · PowerShell/PowerShell
X Title: Need syntax or cmdlet for globbing with space (i.e. glue quoted literals with globs) · Issue #13098 · PowerShell/PowerShell
Description: I found this issue while trying to take on #13089 myself. It's a minor headache to be unable to glob stuff with escapes and embedded spaces. This is not a limitation in POSIX shell, nor is it one in the original glob(3) language. Steps t...
Open Graph Description: I found this issue while trying to take on #13089 myself. It's a minor headache to be unable to glob stuff with escapes and embedded spaces. This is not a limitation in POSIX shell, nor is it one i...
X Description: I found this issue while trying to take on #13089 myself. It's a minor headache to be unable to glob stuff with escapes and embedded spaces. This is not a limitation in POSIX shell, nor is it o...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13098
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Need syntax or cmdlet for globbing with space (i.e. glue quoted literals with globs)","articleBody":"I found this issue while trying to take on #13089 myself. It's a minor headache to be unable to glob stuff with escapes and embedded spaces. This is not a limitation in POSIX shell, nor is it one in the original glob(3) language.\r\n\r\n## Steps to reproduce\r\n\r\n```powershell\r\n# prepare\r\n$a = mktemp -d\r\ncd $a\r\nmkdir \"A B\"\r\n# test\r\n/bin/echo \"A \"*\r\n/bin/echo *' B'\r\n/bin/echo *` B\r\n# ast poke sans globbing\r\nWrite-Output \"A \"*\r\nWrite-Output *' B'\r\n```\r\n\r\n## Expected behavior\r\n\r\n```none\r\nA B\r\nA B\r\nA B\r\n(pwsh stuff)\r\n(pwsh stuff)\r\n```\r\n\r\n## Actual behavior\r\n\r\n```none\r\nA A B\r\n* B\r\n* B\r\nA \r\n*\r\n* B\r\n```\r\n\r\n## Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 7.0.2\r\nPSEdition Core\r\nGitCommitId 7.0.2\r\nOS Darwin 19.5.0 Darwin Kernel Version 19.5.0: Tue…\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\n```\r\n\r\n## How did this happen?\r\nTest case (4) indicates that the parser sees two string literals glued together as two distinct \"words\". This *could* be improved without breakings stuff by just making a cmdlet for globbing a mixture of quoted (to be escaped) and bare (to be put into the pattern raw) character runs.\r\n\r\nTest case (3) indicates that the heuristic in `NativeCommandParameterBinder::AppendOneNativeArgument` is inadequate. Even when fed a valid glob, it sees the space in the string and decides that it is non-globbable from that. Bad idea.","author":{"url":"https://github.com/Artoria2e5","@type":"Person","name":"Artoria2e5"},"datePublished":"2020-07-04T18:47:38Z","url":"https://github.com/PowerShell/PowerShell/issues/13098"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1082983c-05d0-90ac-6225-d9795ae10f40 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6C2:2C8E0B:254F74:32E122:6AFD51EA |
| html-safe-nonce | 8d85ff7ffbded4cd840924724f198ed9192100ca50028508c131bff1ecd9092b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkMyOjJDOEUwQjoyNTRGNzQ6MzJFMTIyOjZBRkQ1MUVBIiwidmlzaXRvcl9pZCI6Ijc2ODk3MDk2Mzc1MzE5NDc0OTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 32ea232532c1ed3462132c12ce23ff1bf7a733f01fc6744da20d18cbbd147b9c |
| hovercard-subject-tag | issue:650938509 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/13098/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9df57ed5d1e8758e5403ccb6c0da031c09ffc4dab3e355ae68a7a85efb542649/PowerShell/PowerShell/issues/13098 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9df57ed5d1e8758e5403ccb6c0da031c09ffc4dab3e355ae68a7a85efb542649/PowerShell/PowerShell/issues/13098 |
| og:image:alt | I found this issue while trying to take on #13089 myself. It's a minor headache to be unable to glob stuff with escapes and embedded spaces. This is not a limitation in POSIX shell, nor is it one i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Artoria2e5 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width