【问题标题】:run specific perl script from command line从命令行运行特定的 perl 脚本
【发布时间】:2014-04-11 05:58:56
【问题描述】:

没有太多编程经验,但我看到了这个开源代码,供大家谈论的速读器之一使用,并认为尝试在我自己的计算机上运行它会很酷。

文件可在此处获得:https://github.com/pasky/speedread

我想知道我应该在命令提示符中输入什么来让程序运行。我的电脑上已经有一个 perl 解释器。但我不确定如何让程序运行。对不起,如果这是一个超级无聊的问题。

我试过了

perl C:\speadread-master\speedread (and yes, it was on the C: drive)

我得到了错误:

Use of encoding pragma is deprecated at C:\speadread-master\speedread line 39.
'stts' is not recognized as an internal or external command, operable program of batch file. 
←[31mc←[0←[K

我也试过了(因为它出现在 github 的 gif 中)

~/speedread$ head -n 21 tea.txt | ./speedread -w 250

我得到了错误:

'~' is not recognized as an internal or external command, operable program or batch file

【问题讨论】:

  • stty 的用法来看,该程序似乎是 Unix 特定的——你不能在 Windows 上使用它。但除此之外,您第一次尝试执行该脚本是正确的。

标签: perl command-line github command-prompt


【解决方案1】:

除了amoncomment,wo 指出了对 Unix 命令/显示的强烈依赖,您还误解了 head 命令:

~/speedread$ 是一个 Unix command promptwith ~ 指的是您的 HOME 目录(USERPROFILE 在 Windows 中)。你不应该输入它。

实际的命令是:

head -n 21 tea.txt | ./speedread -w 250

您的 git msysgit 分发版 (bin/head.exe) 中有一个 head.exe(Windows 版本的 unix 命令 head)。

【讨论】:

    猜你喜欢
    • 2013-07-18
    • 1970-01-01
    • 2016-07-14
    • 2011-05-31
    • 2016-02-20
    • 2013-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多