LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > karanis
User Name
Password

Notices


Rate this Entry

BASH read file

Posted 04-05-2020 at 05:17 PM by karanis
Tags bash

https://www.cyberciti.biz/faq/unix-h...ine-from-file/

https://www.computerhope.com/unix/bash/read.htm

https://www.shellhacks.com/bash-read...ead-line-loop/

----------

while read USER; do echo "Hello $USER!"; done < users.txt

----------

#!/bin/ksh
file="/home/vivek/data.txt"
while IFS= read line
do
# display $line or do something with $line
echo "$line"
done <"$file"
Posted in Uncategorized
Views 314 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration