Title: Enable backslash as alternative path delimiter · Issue #570 · PowerShell/PowerShell · GitHub
Open Graph Title: Enable backslash as alternative path delimiter · Issue #570 · PowerShell/PowerShell
X Title: Enable backslash as alternative path delimiter · Issue #570 · PowerShell/PowerShell
Description: Windows PowerShell allows both \ and / be path delimiters. Consider # Full PS on Windows PS C:\> 'foo' > bar PS C:\> cat ./bar foo PS C:\> cat .\bar foo Versus # Linux version PSL /Users/vors/dev/PowerShell-Linux> 'foo' > bar PSL /Users/...
Open Graph Description: Windows PowerShell allows both \ and / be path delimiters. Consider # Full PS on Windows PS C:\> 'foo' > bar PS C:\> cat ./bar foo PS C:\> cat .\bar foo Versus # Linux version PSL /Users/vors/dev/P...
X Description: Windows PowerShell allows both \ and / be path delimiters. Consider # Full PS on Windows PS C:\> 'foo' > bar PS C:\> cat ./bar foo PS C:\> cat .\bar foo Versus # Linux version P...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/570
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enable backslash as alternative path delimiter","articleBody":"Windows PowerShell allows both `\\` and `/` be path delimiters.\n\nConsider\n\n```\n# Full PS on Windows\nPS C:\\> 'foo' > bar\nPS C:\\> cat ./bar\nfoo\nPS C:\\> cat .\\bar\nfoo\n\n```\n\nVersus \n\n```\n# Linux version\nPSL /Users/vors/dev/PowerShell-Linux> 'foo' > bar\nPSL /Users/vors/dev/PowerShell-Linux> cat ./bar\nfoo\nPSL /Users/vors/dev/PowerShell-Linux> cat .\\bar\ncat : Cannot find path '/Users/vors/dev/PowerShell-Linux/.\\bar' because it does not exist.\n```\n\nIt's a problem for **porting**: there are scripts that could run as-is, but don't because of the wrong path delimiters.\n\nOn the other hand, on Linux you can create a folder `foo\\bar`, so adding `\\` as alternative path separator would make this corner case harder.\n\nThis problem can be solved with additional escaping \n\n```\ncd foo`\\bar\n```\n\n**Sidenote**: 'Set-Location' (`cd`) currently fails for it, but `Get-ChildItem` (`ls`) works\n\n```\nPSL /Users/vors/dev/PowerShell-Linux> ls ./foo\\bar/\n\n\n Directory: /Users/vors/dev/PowerShell-Linux/foo\\bar\n\n\nMode LastWriteTime Length Name \n---- ------------- ------ ---- \n------ 2/20/16 9:38 PM 6 1 \n\n\nPSL /Users/vors/dev/PowerShell-Linux> cd ./foo\\bar/\ncd : An object at the specified path /Users/vors/dev/PowerShell-Linux/foo\\bar does not exist.\n```\n","author":{"url":"https://github.com/vors","@type":"Person","name":"vors"},"datePublished":"2016-02-21T05:45:49Z","url":"https://github.com/PowerShell/PowerShell/issues/570"}
| 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:696b577e-4637-4967-7dd0-d3812b5a1ae7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88B6:274D5F:53FFCF:799F36:6AFD751A |
| html-safe-nonce | 67a4301920208bbb282169ad05cc651ce6c6de22b989789fd71f9a37b5627465 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEI2OjI3NEQ1Rjo1M0ZGQ0Y6Nzk5RjM2OjZBRkQ3NTFBIiwidmlzaXRvcl9pZCI6Ijg5MjM5MjMxNzM1NjExNjkxNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 62a2f813ceef71ec91d27319cd1ba8c7a53405ec7c266027da4c79a7bfa7e44b |
| hovercard-subject-tag | issue:135164280 |
| 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/570/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34d983121535581d6b83f8ae830c5842ba38b10425cb494c558c5af2bba24556/PowerShell/PowerShell/issues/570 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34d983121535581d6b83f8ae830c5842ba38b10425cb494c558c5af2bba24556/PowerShell/PowerShell/issues/570 |
| og:image:alt | Windows PowerShell allows both \ and / be path delimiters. Consider # Full PS on Windows PS C:\> 'foo' > bar PS C:\> cat ./bar foo PS C:\> cat .\bar foo Versus # Linux version PSL /Users/vors/dev/P... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vors |
| hostname | github.com |
| expected-hostname | github.com |
| None | e54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032 |
| 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 | 5be0bf2b8cf26f8897d31e6bc3c232d328b12a54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width