我有一堆日志文件.我需要找出所有文件中出现字符串的次数.
grep -c string *
Run Code Online (Sandbox Code Playgroud)
回报
...
file1:1
file2:0
file3:0
...
Run Code Online (Sandbox Code Playgroud)
使用管道我只能获得具有一个或多个出现次数的文件:
grep -c string * | grep -v :0
...
file4:5
file5:1
file6:2
...
Run Code Online (Sandbox Code Playgroud)
我怎样才能得到合并计数?(如果它返回file4:5, file5:1, file6:2
,我想回来8.)
我前段时间在github上分叉了一个存储库,进行了一些小改动并将更改推回到我的github fork.原来的存储库已经改变了.我想将原始存储库中的更改合并到我的fork中.
我是git和github的新手,我需要具体的命令如何做到这一点.
我有一个选择列表:
<select id="filter">
<option value="Open" selected="selected">Open</option>
<option value="Closed">Closed</option>
</select>
Run Code Online (Sandbox Code Playgroud)
当我选择Closed
页面重新加载时.在这种情况下,它显示已关闭的票证(而不是打开).我手动操作时工作正常.
问题是当我Closed
用Watir选择时页面不会重新加载:
browser.select_list(:id => "filter").select "Closed"
Run Code Online (Sandbox Code Playgroud)
这通常意味着不会触发某些JavaScript事件.我可以用Watir发射事件:
browser.select_list(:id => "filter").fire_event "onclick"
Run Code Online (Sandbox Code Playgroud)
但我需要知道要开火的事件.
有没有办法找出为元素定义了哪些事件?
我有一个排序数组:
[
'FATAL <error title="Request timed out.">',
'FATAL <error title="Request timed out.">',
'FATAL <error title="There is insufficient system memory to run this query.">'
]
Run Code Online (Sandbox Code Playgroud)
我想得到这样的东西,但它不一定是哈希:
[
{:error => 'FATAL <error title="Request timed out.">', :count => 2},
{:error => 'FATAL <error title="There is insufficient system memory to run this query.">', :count => 1}
]
Run Code Online (Sandbox Code Playgroud) 我刚收到此错误消息:
...
from c:/ruby/lib/ruby/gems/1.8/gems/...
... 10 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/...
...
Run Code Online (Sandbox Code Playgroud)
并且bug(当然)隐藏在某处... 10 levels...
.
如何强制ruby显示完整的堆栈跟踪?
我从Jenkins 网站下载了Mac OS X本机包,安装它,在http:// localhost:8080 /打开我的浏览器,并获得了包含以下文本的错误页面:
Status Code: 404
Exception: Request URL / not found.<br><br>
Stacktrace:
Generated by Winstone Servlet Engine v0.9.10 at Tue Nov 29 12:00:52 CET 2011
Run Code Online (Sandbox Code Playgroud)
我发现jenkins.war
在/Applications/Jenkins
,并试图运行它java -jar jenkins.war
:
$ pwd
/Applications/Jenkins
$ ls
jenkins.war
$ java -jar jenkins.war
Running from: /Applications/Jenkins/jenkins.war
webroot: $user.home/.jenkins
[Winstone 2011/11/29 12:03:12] - Beginning extraction from war file
Jenkins home directory: /Users/zeljko/.jenkins found at: $user.home/.jenkins
[Winstone 2011/11/29 12:03:16] - Winstone shutdown successfully
[Winstone …
Run Code Online (Sandbox Code Playgroud) 我已将gemcutter.org添加到我的Rubygems源代码中,现在我不知道如何删除它.
$ gem sources
*** CURRENT SOURCES ***
http://gemcutter.org
http://gems.rubyforge.org/
Run Code Online (Sandbox Code Playgroud) 我已经在Windows 2008 32位上通过Git/SSH成功克隆了Jenkins中的Git存储库.当我尝试在Windows 2008 64位上执行相同操作时,控制台输出页面卡在此处:
Démarré par l'utilisateur anonymous
Checkout:book / C:\Jenkins\workspace\book - hudson.remoting.LocalChannel@1da691a
Using strategy: Default
Last Built Revision: Revision 5d7ce4ae23c91fb201ee005e6db17bcd795ca965 (origin/HEAD, origin/master)
Checkout:book / C:\Jenkins\workspace\book - hudson.remoting.LocalChannel@1da691a
Cloning the remote Git repository
Cloning repository origin
Run Code Online (Sandbox Code Playgroud)
当我停止构建时(在卡住那里几分钟后),我得到了剩下的错误消息:
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:zeljkofilipin/watirbook.git
ERROR: Cause: Error performing command: C:\Git\bin\git.exe clone --progress -o origin git@github.com:zeljkofilipin/watirbook.git C:\Jenkins\workspace\book
null
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone …
Run Code Online (Sandbox Code Playgroud)