Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Looping through the content of a file in Bash
- # source: https://stackoverflow.com/questions/1521462/looping-through-the-content-of-a-file-in-bash
- # iterating over lines of text file
- #
- while read line; do
- echo "$line"
- done <blt_devs.txt
- # iterating over stdout returning directly from an app
- #
- bluetoothctl devices | while read line; do echo $line; done
- # or
- bluetoothctl devices | while read line || [[ -n $line ]]; do echo $line; done
- # or
- while read line; do echo $line; done < <(bluetoothctl devices)
- # what '< <' means:
- # see: What's the difference between <<, <<< and < < in bash?
- # https://askubuntu.com/questions/678915/whats-the-difference-between-and-in-bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement