你的位置:首页 > 软件开发 > ASP.net > linux下的powershell,pash试用手记

linux下的powershell,pash试用手记

发布时间:2015-03-11 18:00:39
------1 概述------1.1 简单来说linux,unix是非常依赖脚本的,而win不是。win中有很多图形程序+c库,效率不比脚本差。点几下鼠标照样能完成需求。当 然,图形和字符是两码事,不能完全替代。1.2 win中的bat和linux中的bash都是老脚本语言,纵 ...

------1 概述------

1.1 简单来说linux,unix是非常依赖脚本的,而get='_blank'>win不是。win中有很多图形程序+c库,效率不比脚本差。点几下鼠标照样能完成需求。当 然,图形和字符是两码事,不能完全替代。

1.2 win中的bat和linux中的bash都是老脚本语言,纵横沙场几十年,功勋卓著。但由于太老,有很多限制和缺陷。用起来比python和powershell差 很多,麻烦很多。一般来讲玩python和powershell的不乐意用。总之新的大有替代老的之势。

1.3 简单来讲pash就是bash+第三方的powershell。

1.4 pash比bash(主要)好在哪?

1.4.1 我认为pash继承了powershell的语法简单,符合习惯的优点。 如用大花括号来做代码段头尾,有foreach,等。

1.4.2 pash调用mono库,是面向对象脚本。支持静态、动态.net类。 如:"aBc".toupper()

当然类库的支持还很不完善,需要你贡献代码。

1.5 至c#程序猿:

虽然powershell调用.net的语法比c#简单,但很多c#人并不想用powershell语法。 他们想用c#语法另做shell,因为他们熟悉c#,他们眼中的shell语法应该和c#相同。

但他们还是绕不过【面向对象的命令行类库】吧。 【面向对象的命令行类库】大都在System.Management里, 还有【支持对象的管道】功能,是从powershell开始,才发明的。

 

powershell 传教士 原创文章 始于2014-09-20,2014-11-30,2015-01-18,2015-03-11修改。文章版本目前博客园为最新版。 允许转载,但必须保留名字和出处,否则追究法律责任

 

------2 pash目前实现了,下述命令:------

linux下的powershell,pash试用手记linux下的powershell,pash试用手记
Add-MemberAdd-PSSnapinAdd-Type                                  Clear-Variable                                  Convert-Path                                 ConvertTo-Csv                                  ConvertTo-Html                                 Copy-Item                                  Export-Csv                                  ForEach-Object                                  Format-Default                                  Format-List                                  Format-Table                                  Get-ChildItem Get-Command Get-Date Get-Help Get-History Get-Host Get-Location Get-Member Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Random Get-Service Get-Variable Import-Csv Join-Path Move-Item New-Alias New-Item New-Object New-Variable Out-Default Out-File Out-Null Remove-Item Remove-PSSnapin Remove-Variable Rename-Item Restart-ServiceResume-Service Select-Object Set-Alias Set-Location Set-Variable Sort-Object Split-Path Start-Service Start-Sleep Stop-Process Stop-Service Suspend-Service Tee-Object Write-Debug Write-Error Write-Host Write-Output Write-Progress Write-Verbose Write-Warning

原标题:linux下的powershell,pash试用手记

关键词:linux

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录