Skip to Content
Exploring Expect
book

Exploring Expect

by Don Libes
December 1994
Intermediate to advanced
606 pages
16h 7m
English
O'Reilly Media, Inc.
Content preview from Exploring Expect

Matching A Null

By default, nulls (bytes with value zero) are automatically stripped from the spawned process output. This can be disabled by setting the integer variable exp_remove_nulls to 0 and reenabled by setting it to 1.

Once null stripping is disabled, nulls can be matched using exp_null. A string-style pattern is still passed, but it is only used for bookkeeping and debugging. For example:

exp_expectl(fd,
    exp_null, "zero byte", 1,
    exp_end);

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI Agents in Action

AI Agents in Action

Micheal Lanham
Learning Go

Learning Go

Jon Bodner

Publisher Resources

ISBN: 9781565920903Supplemental ContentErrata Page