TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Pash: PowerShell open source reimplementation for Linux, Mac, & Solaris

33 点作者 rayvega超过 14 年前

4 条评论

geophile超过 14 年前
I've built something along these lines, Object Shell: <a href="http://geophile.com/osh" rel="nofollow">http://geophile.com/osh</a>, (GPL license). Object Shell provides for piping of python objects between commands. For example,<p><pre><code> bash-3.2$ osh ls -f ^ select 'f: f.size &#62; 20000' $ ('./.DS_Store',) ('./.psql_history',) ('./backup.log',) ('./loljack.jpg',) </code></pre> osh invokes the interpreter. ls is osh's ls command. The -f flag restricts the ls command to files. ^ is the osh pipe character, so the list of files in the current directory is piped to the next command. select filters out objects that don't pass the predicate, in this case, that file.size &#62; 20000. $ renders output (using python's str()).<p>osh also does database access, e.g.<p><pre><code> osh sql "select * from my_table" $ </code></pre> and remote access. E.g., to run the same query on every node of a cluster named foobar:<p><pre><code> osh @foobar [ sql "select count(*) from my_table" ] $ </code></pre> Piping python tuples between commands and then operating on them from the command line is really handy.<p>Object Shell also has a python API, e.g.<p><pre><code> #!/usr/bin/python from osh.api import * osh(remote('foobar', sql("select count(*) from my_table")), out())</code></pre>
评论 #1850435 未加载
thesethings超过 14 年前
I really hope I'm wrong about this, but I think this was all but abandoned in 2008ish, and is missing a lot of what's in PS.<p>(check date of newest files <a href="http://sourceforge.net/projects/pash/files/" rel="nofollow">http://sourceforge.net/projects/pash/files/</a>)<p>It's really too bad, as there are some interesting tools written in Powershell-only/first mode. I was on the hunt for something like this a little while back when I had some cool VMware tools that were only in Powershell, but wanted to run them from Linux.<p>Would love to hear I'm wrong about this, or that there's another ps implementation for those on Linux/ Mac.<p>Here is a more recent thread pining for cross-platform Powershell.<p><a href="http://go-mono.com/forums/#nabble-td1573385" rel="nofollow">http://go-mono.com/forums/#nabble-td1573385</a>
评论 #1850447 未加载
toisanji超过 14 年前
What are the benefits of using pash(powershell) over bash?
评论 #1850522 未加载
评论 #1849891 未加载
评论 #1850431 未加载
评论 #1849985 未加载
jonhendry超过 14 年前
Does it implement a sucky Windows-style Console?
评论 #1852148 未加载