参加一个自我指导的 linux 教程,我一直对此感到困惑
我的输出一直包括“时钟 15”,请帮忙
#!/bin/sh
#comment single RegEx to match all of the items that you have enough rupees
sed '1d' hw0207.txt | grep -v [2-9][0-9]
#comment grep will filter all numbers greater than 12, -v represents not
#comment first sed was to remove first line
我正在尝试编写一个正则表达式来匹配您有足够卢比的所有项目。不要只匹配线,你应该匹配你能负担得起的线,这样如果价格发生变化,答案仍然是正确的。你只有 12 卢比,如果你想买更多的东西,你需要变得更富有一点。
Input file (hw0207.txt) Expected output of script
item cost
lamp oil 5
rope 10
clock 15
bombs 20