itadmin01

Wednesday, July 3, 2013

Bash "while" loop

1) Either:

while read line
do
...
done < my_file.txt


2) Or:

cat my_file.txt | while read LINE
do
...
done



http://www.tldp.org/LDP/abs/html/internal.html#READPIPEREF

Posted by itadmin01 at Wednesday, July 03, 2013
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2015 (2)
    • ►  August (1)
    • ►  March (1)
  • ►  2014 (3)
    • ►  November (1)
    • ►  January (2)
  • ▼  2013 (17)
    • ►  September (1)
    • ►  August (1)
    • ▼  July (12)
      • Microsoft SQL Report Builder - Hyperlink in textbox
      • sudo basics
      • Linux iptables - open some ports to allow some tra...
      • DHCP packets in Wireshark
      • Bash "while" loop
      • Find domain controlers for domain
      • awk tips
      • Don't redirect Picasa to Google +
      • Destroy Xen Domain (virtual host)
      • Add watermark in batch with ImageMagic
      • Change hostname to permanent on RedHat like Linux ...
      • Create (install) new Xen Virtual Machine in text mode
    • ►  June (1)
    • ►  May (2)

About Me

View my complete profile
Simple theme. Powered by Blogger.