Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望能够使用从某个行号开始并以给定模式结束的 sed 提取 bash 脚本中的文本。现在我有sed "${LINE_NUM}p;d" $FROM_FILE,但只返回行号上的文本$LINE_NUM。如果我想从$LINE_NUM一直到某种文本模式开始获取文本怎么办?
sed "${LINE_NUM}p;d" $FROM_FILE
$LINE_NUM
你可以做:
sed -n "${LINE_NUM},/regex/p" "$FROM_FILE"
确保\b对文本使用单词边界以获得完美匹配而不是模糊。
\b
I am trying to fade a text box within specified time. This code works on Windows Phone but it doesn't work in a Windows 8 application. I made changes to fix as many errors as