This file contains 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 'dart:io'; | |
import 'package:dshell/dshell.dart'; | |
/// duntar <tarfile> | |
/// untars a file | |
void main(List<String> args) { | |
var parser = ArgParser(); | |
var results = parser.parse(args); |
This file contains 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
import 'dart:async'; | |
import 'dart:convert'; | |
import 'dart:io'; | |
void main() async { | |
var ls = await start('ls'); | |
var head = await start('head'); | |
var headStdout = head.stdout; |
This file contains 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 'dart:io'; | |
import 'package:dshell/dshell.dart'; | |
/// dwhich appname - searches for 'appname' on the path | |
void main(List<String> args) { | |
var parser = ArgParser(); | |
parser.addFlag('verbose', abbr: 'v', defaultsTo: false, negatable: false); | |
var results = parser.parse(args); |
This file contains 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 'dart:io'; | |
import 'package:dshell/dshell.dart'; | |
void main(List<String> args) { | |
print('${args.length} were passed'); | |
int index = 0; | |
for (var arg in args) | |
{ |
This file contains 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(List<String> args) { | |
print('${args.length} were passed'); | |
int index = 0; | |
for (var arg in args) | |
{ | |
print('arg $index = $arg); |
This file contains 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))); | |
} |
This file contains 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'.run; | |
} |
This file contains 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
dshell create hellow.dart | |
Creating project. | |
Created Virtual Project at /home/bsutton/.dshell/cache/home/bsutton/git/dshell/test/test_scripts/hellow.project | |
Running pub get... | |
Resolving dependencies... | |
+ args 1.5.2 | |
+ charcode 1.1.2 | |
+ collection 1.14.12 | |
+ dshell 1.0.36 | |
+ equatable 1.0.2 |
This file contains 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
chmod +x hello_world.dart | |
./hello_world.dart |
This file contains 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() { | |
print('Hello World'); | |
} |