You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make PowerShell not only POSIX compliant, but also ZSH & BASH compatible.
I don't want to start any kind of negative feedback loop here, but I'm thinking about a way for folks like me to give PowerShell a chance. I've used it off and on for years and each time I've used it I have always spit and cursed under my breath about how on earth could MS be pushing backwards vs forging ahead with a proven technology that sys admins and developers already know and love around the globe. I'm impressed that Microsoft is taking such steps as open sourcing this and I think this kind of an attempt at a visionary movement forward is both honorable and praiseworthy.
In an effort to unify the shell world, I think PowerShell could get really creative by providing a ZSH and BASH compatibility layer. Frankly I'd probably use PowerShell if I could do this as I'd feel good about it being supported by a serious, large and long term investor like Microsoft - even though it would be on macOS for my OS flavor.
So to this end, could you please implement a POSIX compliant layer in conjunction with ZSH and BASH compatibility that would allow us to bring our decades of accrued shell scripts and configurations over to PowerShell?
Reacted by aenima4six2, redfave, 145a and Mr Beedell, Roke Julian Lockhart
ylluminate (@ylluminate) Even though this has been marked as answered, I'd like to ask you a few questions if you're still paying attention to this thread.
I've used it off and on for years and each time I've used it I have always spit and cursed under my breath about how on earth could MS be pushing backwards vs forging ahead with a proven technology that sys admins and developers already know and love around the globe.
Can you go into a bit more detail on this point? What about it has made you "spit and curse" when using it? What makes you feel MS is pushing backwards vs forging ahead?
In an effort to unify the shell world, I think PowerShell could get really creative by providing a ZSH and BASH compatibility layer.
What does such a compatibility layer look like to you? Are there specific things you want added? If so, can you share some examples? Or did the replies above telling you that you could just invoke bash with an inline script really address your concerns? Since you didn't respond, I have no idea if that is all you were looking for or not.
FYI, related to this topic, there are some discussions going on about adding language syntax that has bash users in mind. For example, this RFC that is currently in a PR. It proposes adding chaining via && and ||. If it's more features like those that you're looking for, what else?
Reacted by Michael Klement, ExE Boss, Mr Beedell, Roke Julian Lockhart and 145a
Old post, but as far as I can tell, Powershell is NOT currently POSIX compatible, as Ilya (@iSazonov) suggested. I've been toying around with it since I've been trying out fvim on windows. There are basic POSIX things that aren't supported and just not there.
To demystify what "POSIX compatibility" means for users like Kirk Munro (@KirkMunro), it basically just amounts to support for a subset of syntax and functionality called the POSIX Shell, which is laid out in this document. It includes things like, but not limited to:
$@, which is equivalent to $args
$1, $2, etc to get the first and second arguments, and so on
if / fi, case / esac syntax
This syntax looks super fugly, especially for those who are used to the way PS does things. However, it's an important stepping stone, because it would attract people from the linux world who may have kept from switching to PS as their main scripting shell because their scripts wouldn't be guaranteed to run in PS.
Reacted by aenima4six2 and Mr Beedell, Roke Julian Lockhart
PowerShell does not parse variable assignments in a POSIX-compliant way, see the same document linked above, section 2.9.1 Simple Commands. FOO=bar echo "$FOO" should print bar.
POSIX compatibility of PS would be a huge benefit in the long run, especially for dev teams using different operating systems.
Git Hooks are a pain when they either only work on Unix bases Systems or Windows, just because PS is not POSIX compliant.
Activity
iSazonov commentedon Apr 5, 2019
This has already been done. You can run these scripts from PowerShell just like any other application.
KirkMunro commentedon Jun 17, 2019
ylluminate (@ylluminate) Even though this has been marked as answered, I'd like to ask you a few questions if you're still paying attention to this thread.
Can you go into a bit more detail on this point? What about it has made you "spit and curse" when using it? What makes you feel MS is pushing backwards vs forging ahead?
What does such a compatibility layer look like to you? Are there specific things you want added? If so, can you share some examples? Or did the replies above telling you that you could just invoke bash with an inline script really address your concerns? Since you didn't respond, I have no idea if that is all you were looking for or not.
FYI, related to this topic, there are some discussions going on about adding language syntax that has bash users in mind. For example, this RFC that is currently in a PR. It proposes adding chaining via
&&and||. If it's more features like those that you're looking for, what else?MyriaCore commentedon Jul 13, 2020
Old post, but as far as I can tell, Powershell is NOT currently POSIX compatible, as Ilya (@iSazonov) suggested. I've been toying around with it since I've been trying out fvim on windows. There are basic POSIX things that aren't supported and just not there.
To demystify what "POSIX compatibility" means for users like Kirk Munro (@KirkMunro), it basically just amounts to support for a subset of syntax and functionality called the POSIX Shell, which is laid out in this document. It includes things like, but not limited to:
$@, which is equivalent to$args$1,$2, etc to get the first and second arguments, and so onif/fi,case/esacsyntaxThis syntax looks super fugly, especially for those who are used to the way PS does things. However, it's an important stepping stone, because it would attract people from the linux world who may have kept from switching to PS as their main scripting shell because their scripts wouldn't be guaranteed to run in PS.
brandones commentedon Mar 9, 2022
PowerShell does not parse variable assignments in a POSIX-compliant way, see the same document linked above, section 2.9.1 Simple Commands.
FOO=bar echo "$FOO"should printbar.redfave commentedon Nov 22, 2024
POSIX compatibility of PS would be a huge benefit in the long run, especially for dev teams using different operating systems.
Git Hooks are a pain when they either only work on Unix bases Systems or Windows, just because PS is not POSIX compliant.