Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
- You want to compare 2 streams, with byte offset and line numbers?
- Pull off content with a byte offset?
- Display lines before or after a pattern?
- Send an email - upon job failure?
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5 # cmp good for comparing output with file contents, or diffing files. Outputs byte offset and line number. md5sum creates a hash (checksum) of file. dd bs=1 skip=106 if=infile # disk to disk copy, example outputs infile with offset of 106 bytes (block size of 1 byte, skip 106 bytes). - Ever needed to display a line before or after a pattern. Yep sure you can use Perl, but this is a bit simplier to work out.
See the code here See a run through screen shot here Usage - ppgrep #1 #2 pattern file - where #1 is the number of lines prior to the pattern (could be 0) and #2 is number of lines post pattern. - Sending email upon UNIX cron failure
|
Leave a Reply