test.sh

#!/bin/bash
for str in "C语言" "http://www.bilibili.com" "成立7年了" "日IP数万"
do
    echo $str >>demo.txt  #将输入结果以追加的方式重定向到文件
done

 

执行

sudo chmod +x test.sh
./test.sh
cat demo.txt

输出

C语言
http://www.bilibili.com
成立7年了
日IP数万

 

相关文章:

  • 2022-12-23
  • 2022-02-21
  • 2021-10-02
  • 2021-04-21
猜你喜欢
  • 2022-01-09
  • 2021-09-25
  • 2021-08-30
  • 2021-10-31
相关资源
相似解决方案