将 Perl 脚本导出到 Windows
我在 Linux 服务器上有几十个 Perl 脚本,我想在我的桌面上使用一些脚本。我的系统上安装了活动 perl。
我的问题是,由于 Windows 没有本机 ssh,我如何使用该脚本?我的脚本用于通过 ssh 登录到 cisco 设备。
有什么建议或想法吗?提前致谢。
I have dozens of perl script on linux server, and I want use some of the script on my desktop. I have active perl installed on my system.
My question is since windows does not have native ssh how I can use the script? My script is use to login to cisco devices via ssh.
Any suggestions or ideas? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Net::SSH::W32Perl 的文档说:
The documentation for Net::SSH::W32Perl says:
我过去曾成功使用过 Net::SSH2 。
I've successfully used Net::SSH2 in the past.
您可能还想考虑使用 Strawberry Perl
除此之外,您应该能够在 Windows 命令行中运行脚本使用:
您还可以将 .pl 文件扩展名与 Perl 相关联,然后双击它们以在命令窗口中启动它们。我假设 ActivePerl 默认执行此操作。我知道 Strawberry Perl 可以。
You might also want to consider using Strawberry Perl
Aside from that, you should be able to run your scripts in the Windows command line using:
You can also associate the .pl file extension with Perl and double click on them to start them in the command window. I assume that ActivePerl does this by default. I know that Strawberry Perl does.
举个例子,每当我想假装我的 Windows 机器实际上是 Linux 机器时,我就喜欢 Cygwin。大多数时候都是这样。特别是,我宁愿安装 Cygwin 的 openssl 包,也不愿尝试在 Windows 上构建和/或配置 libssh2。与在 Windows 上构建和配置 libssh2 相比,我宁愿做很多事情。
我还发现,将 Perl 脚本从 Linux 移植到 Cygwin 上运行比在 Windows 上运行要少一些工作(尽管需要做的工作记录较少)。
I, for one, love Cygwin whenever I would like to pretend that my Windows box is actually a Linux box. Which is most of the time. In particular, I would rather install Cygwin's
openssl
package rather than try to build and/or configure libssh2 on Windows. There are a lot of things I would rather do than build and configure libssh2 on Windows.I also find that there is less work to do in porting a Perl script from Linux to run on Cygwin than to run on Windows (though what work there is to do is less well documented).