Shell – Unix equivalent of PowerShell

shell

I've always found it awkward when complex shell commands involve parsing text output with AWK. Basically we're converting structured data into text, then parsing the text again to get back at the structured data.

PowerShell is a Windows shell which avoids that problem by allowing you to pipe typed objects between shell commands instead of just text.

Are there any Unix shells which are object-based instead of text-based, like PowerShell?

Best Answer

No, it is the other way around. There is no spoon^H^H^Hstructured data. There is only text.

A big part of the Unix philosophy is based on the idea of outputting text and accepting text as input. You might want to consider reading "The Art of Unix Programming", which has a nice explanation about this.

Don't get me wrong: I understand your point and I know what you are trying to get at. There are things like the interactive interpreters of Ruby and Python, which can be used as a shell, but they are not as friendly for basic tasks as Bash is. Try and change directory, for example.

Also, using objects in a shell is not all-that. If only your shell supports this, on Unix, you would be at a loss. All the standard Unix text manipulation tools would have to be altered, like grep, awk, sed, etc.

I think there has been an attempt to create something like this a few years back, but I can't remember the name and I haven't heard about it in a long time. It's probably not going to take off.