Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/opt/homebrew/bin/bash
- # with curly braces
- test1 () {
- for ((x=0; x< 30000; x++)) {
- echo "foo" | { read bar && echo "$bar" >/dev/null; }
- }
- }
- # with parens
- test2 () {
- for ((x=0; x< 30000; x++)) {
- echo "foo" | ( read bar && echo "$bar" > /dev/null )
- }
- }
- echo "Compound command with curly brackets"
- time test1
- echo "Compound command with parens"
- time test2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement