现有file1、file2、file3三个文件,其内容如下

$cat file1
f1_1
f1_2
f1_3
$cat file2
f2_1
f2_2
f2_3
$cat file3
f3_1
f3_2
f3_3

编写shell脚本逐行读取这三个文件

#!/bin/bash
cat file1 file2 file3 |while read p
  do
    echo $p
  done

wKioL1YnbFei3OsoAADI9g9zU3A856.jpg

【思考】

采用done引入多个文件,怎么实现?

#!/bin/bash
while read p
  do
    echo $p
  done < {several_input_files}