Linux shell script reads multiple files per line

Source: Internet
Author: User

Existing file1, file2, file3 three files, the contents are as follows

$cat File1f1_1f1_2f1_3$cat File2f2_1f2_2f2_3$cat File3f3_1f3_2f3_3

Write a shell script to read these three files line by row

#!/bin/bashcat file1 file2 file3 |while read P do echo $p done

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/74/B7/wKioL1YnbFei3OsoAADI9g9zU3A856.jpg "title=" 1111111.jpg "alt=" Wkiol1ynbfei3osoaadi9g9zu3a856.jpg "/>

Thinking

How do I introduce multiple files with done?

#!/bin/bash
While read P
Do
Echo $p
Done < {several_input_files}

Linux shell script reads multiple files per line

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.