Created
January 13, 2020 09:38
-
-
Save bsutton/b64c388ac7f5e8948eb84dd9e332a1e5 to your computer and use it in GitHub Desktop.
grep forEach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env dshell | |
| import 'package:dshell/dshell.dart'; | |
| void main() { | |
| 'grep error /var/log/syslog'.forEach((line) => print(line)); | |
| 'grep error /var/log/syslog'.forEach((line) { print('matched $line'); }); | |
| 'grep error /var/log/syslog'.forEach((line) => print(line), stderr:(line) => print(red(line))); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment