gpt4 book ai didi

bash - 将文本文件中的行数输出到 Unix 中的屏幕

转载 作者:行者123 更新时间:2023-11-29 08:52:24 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
bash echo number of lines of file given in a bash variable

想知道如何将文本文件中的行数输出到屏幕,然后将其存储在变量中。我有一个名为 stats.txt 的文件,当我运行 wc -l stats.txt 时,它输出 8 stats.txt

我尝试做 x = wc -l stats.txt 认为它只会存储数字,其余的只是为了视觉,但它不起作用:(

感谢帮助

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com