You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`First()` reads its input and passes on the first N lines of it (like Unix [`head`](examples/head/main.go)):
335
+
336
+
```go
337
+
Stdin().First(10).Stdout()
338
+
```
339
+
326
340
### Join
327
341
328
342
`Join()` reads its input and replaces newlines with spaces, preserving a terminating newline if there is one.
@@ -567,11 +581,12 @@ These are some ideas I'm playing with for additional features. If you feel like
567
581
568
582
### Filters
569
583
570
-
* Ideas welcome!
584
+
*`Column()` reads columnar (whitespace-separated) data and cuts the specified column, like Unix `cut`
585
+
*`CountFreq()` counts the frequency of input lines, and prepends each unique line with its frequency (like Unix `uniq -c`). The results are sorted in descending numerical order (that is, most frequent lines first).
@@ -580,10 +595,13 @@ Since `script` is designed to help you write system administration programs, a f
580
595
*[cat](examples/cat/main.go) (copies stdin to stdout)
581
596
*[cat 2](examples/cat2/main.go) (takes a list of files on the command line and concatenates their contents to stdout)
582
597
*[grep](examples/grep/main.go)
598
+
*[head](examples/head/main.go)
583
599
*[echo](examples/echo/main.go)
584
600
585
-
More examples would be welcome!
601
+
[More examples would be welcome!](https://github.com/bitfield/script/pulls)
586
602
587
603
### Use cases
588
604
589
-
The best libraries are designed to satisfy real use cases. If you have a sysadmin task which you'd like to implement with `script`, let me know by opening an issue.
605
+
The best libraries are designed to satisfy real use cases. If you have a sysadmin task which you'd like to implement with `script`, let me know by [opening an issue](https://github.com/bitfield/script/issues/new) - I'd love to hear from you.
606
+
607
+
If you use `script` for real work (or, for that matter, real play), I'm always very interested to hear about it. Drop me a line to [email protected] and tell me how you're using `script` and what you think of it!
0 commit comments