标签:from shel read ber numbers cat 电话 nbsp ash
195. Tenth Line
输出file.txt中的第十行
答案:
# Read from the file file.txt and output the tenth line to stdout. #!/bin/bash sed -n ‘10p‘ file.txt
193. Valid Phone Numbers
找出file.txt中符合(xxx) xxx-xxxx or xxx-xxx-xxxx格式的电话号码
答案:
1 cat file.txt | grep -Eo ‘^(\([0-9]{3}\) )[0-9]{3}-[0-9]{4}$|^([0-9]{3}-){2}[0-9]{4}$‘
标签:from shel read ber numbers cat 电话 nbsp ash
原文地址:http://www.cnblogs.com/fcyworld/p/6417712.html