sed & awk, 2nd Edition by Dale Dougherty;Arnold Robbins
Author:Dale Dougherty;Arnold Robbins
Format: mobi
Tags: COMPUTERS / Operating Systems / UNIX
Publisher: O'Reilly Media
Published: 2010-11-19T00:00:00+00:00
Before any input is read, the bitmap array is loaded with O's. This array has 144 elements. The input to this program is a series of coordinates, one per line.
$ cat bitmap.test
1,1
2,2
3,3
4,4
5,5
6,6
7,7
8,8
9,9
10,10
11,11
12,12
1,12
2,11
3,10
4,9
5,8
6,7
7,6
8,5
9,4
10,3
11,2
12,1
For each coordinate, the program will put an "X" in place of an "O" as that element of the array. At the end of the script, the same kind of loop that loaded the array, now outputs it. The following example reads the input from the file bitmap.test.
$ awk -f bitmap.awk bitmap.test
XOOOOOOOOOOX
OXOOOOOOOOXO
OOXOOOOOOXOO
OOOXOOOOXOOO
OOOOXOOXOOOO
OOOOOXXOOOOO
OOOOOXXOOOOO
OOOOXOOXOOOO
OOOXOOOOXOOO
OOXOOOOOOXOO
OXOOOOOOOOXO
XOOOOOOOOOOX
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12894)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10257)
Hello! Python by Anthony Briggs(10139)
The Mikado Method by Ola Ellnestam Daniel Brolund(10031)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9997)
Dependency Injection in .NET by Mark Seemann(9532)
Hit Refresh by Satya Nadella(9009)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8540)
The Kubernetes Operator Framework Book by Michael Dame(8302)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8100)
Practical Computer Architecture with Python and ARM by Alan Clements(8034)
Robo-Advisor with Python by Aki Ranin(8015)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8014)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7932)
Building Low Latency Applications with C++ by Sourav Ghosh(7902)
Grails in Action by Glen Smith Peter Ledbrook(7899)
Svelte with Test-Driven Development by Daniel Irvine(7897)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7868)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7809)