#!/bin/bash
 
count=1    //赋值语句,不加空格
 
cat test | while read line        //cat 命令的输出作为read命令的输入,read读到的值放在line中
 
do
 
   echo "Line $count:$line"
 
   count=$[ $count + 1 ]          //注意中括号中的空格。
 
done
 
echo "finish"
 
exit 0

输出

Line 1:import json
Line 2:with open('tmp.json', 'r') as f:
Line 3:print("eee")
Line 4:k=json.load(f)
Line 5:print("ddd")
Line 6:print(k)
finish

 

相关文章:

  • 2022-12-23
  • 2022-03-07
  • 2021-08-06
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-16
  • 2021-05-06
  • 2022-12-23
  • 2021-08-23
  • 2021-09-29
  • 2021-09-11
相关资源
相似解决方案