Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
PM-GAWK(1) | Utility Commands | PM-GAWK(1) |
NAME
persistent memory gawk - persistent data and functionsSYNOPSIS
truncate -s size heap.pma
export GAWK_PERSIST_FILE=heap.pma
gawk ...
truncate -s size heap.pma
GAWK_PERSIST_FILE=heap.pma gawk ...
truncate -s size heap.pma
alias pm='GAWK_PERSIST_FILE=heap.pma'
pm gawk ... # succinct
unset GAWK_PERSIST_FILE # disable persistence
export GAWK_PERSIST_FILE=other_heap.pma # change heap
rm heap.pma # delete heap
DESCRIPTION
Gawk 5.2 and later supports a persistent memory feature that can store script-defined variables and functions in a file for later use. The feature, called pm-gawk, is described in GAWK: Effective AWK Programming and in Persistent Memory gawk User Manual.EXAMPLES
Demonstrate persistent variables:$ truncate -s 1G heap.pma # create heap file
$ export GAWK_PERSIST_FILE=heap.pma # "ambient" env var
$ gawk 'BEGIN { print ++i }'
1
$ gawk 'BEGIN { print ++i }'
2
$ gawk 'BEGIN { print ++i }'
3
$ unset GAWK_PERSIST_FILE
$ GAWK_PERSIST_FILE=heap.pma gawk 'BEGIN { print ++i }'
4
$ GAWK_PERSIST_FILE=heap.pma gawk 'BEGIN { print ++i }'
5
$ GAWK_PERSIST_FILE=heap.pma gawk 'BEGIN { print ++i }'
6
$ alias pm='GAWK_PERSIST_FILE=heap.pma'
$ pm gawk 'BEGIN { print ++i }'
7
$ pm gawk 'BEGIN { print ++i }'
8
$ unset GAWK_PERSIST_FILE
$ gawk 'BEGIN { print ++i }'
1
$ gawk 'BEGIN { print ++i }'
1
$ rm heap.pma
ENVIRONMENT VARIABLES
GAWK_PERSIST_FILE contains the name of a heap file where script-defined variables and functions are stored. If this environment variable is not visible to gawk, the persistence feature is not activated and gawk behaves in its traditional manner.VERSION INFORMATION
Persistent memory gawk was first released in gawk 5.2.AUTHORS
Arnold Robbins, the maintainer of gawk, implemented pm-gawk using a persistent memory allocator (pma) provided by Terence Kelly. An earlier proof-of-concept prototype of persistent gawk was developed by Haris Volos, Zi Fan Tan, and Jianan Li using a fork of the official gawk sources.CAVEATS
The GNU/Linux CIFS filesystem is known to cause problems for the persistent memory allocator. Do not use a backing file on such a filesystem with pm-gawk.BUG REPORTS
Follow the procedures in GAWK: Effective AWK Programming and in Persistent Memory gawk User Manual. For suspected bugs related to persistence (as opposed to other non-persistence-related gawk bugs) please also send e-mail to Terence Kelly at one or more of these addresses: tpkelly@acm.org, tpkelly@eecs.umich.edu, or tpkelly@cs.princeton.edu.SEE ALSO
gawk(1), GAWK: Effective AWK Programming, and Persistent Memory gawk User Manual. The two manuals should be available in the Info subsystem if Info installed on your system.COPYING PERMISSIONS
Copyright © 2022 Terence Kelly.Nov 17 2022 | Free Software Foundation |