Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Unix命令打印第一句话_Linux_Unix - Fatal编程技术网

Linux Unix命令打印第一句话

Linux Unix命令打印第一句话,linux,unix,Linux,Unix,给定一个文本文件(textfile.txt),例如: Hello there. I have the high ground. 我如何打印第一句话,使它只是: Hello there. 使用awk或像这样切割 cat textfile.txt | awk -F'.' '{print $1}' 或 为什么您会有使用cat的冲动? cat textfile.txt | cut -d'.' -f1

给定一个文本文件(textfile.txt),例如:

Hello there. I have the high ground.
我如何打印第一句话,使它只是:

Hello there.

使用awk或像这样切割

cat textfile.txt | awk -F'.' '{print $1}'


为什么您会有使用
cat
的冲动?
cat textfile.txt | cut -d'.' -f1