Guest User

Untitled

a guest
May 13th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Bash while loop that reads file line by line
  2. #!/bin/bash
  3.  
  4. while read line
  5. do
  6. echo-e "$ line n"
  7. done <file.txt
  8.  
  9. #!/bin/bash
  10. exec 3<file.txt
  11.  
  12. while read line
  13. do
  14. echo-e "$ line n"
  15. done
  16.  
  17. exec <file.txt
  18.  
  19. exec 3<file.txt
  20.  
  21. while read -u3 line
  22. do
  23. echo -e "$line n"
  24. done
  25.  
  26. #!/bin/bash
  27. exec 3<file.txt
  28.  
  29. while read line
  30. do
  31. echo -e "$line n"
  32. done <&3
Advertisement
Add Comment
Please, Sign In to add comment