Example of a program using 'awk'.
This easy awk program generates an rpv file containing the current environment for Unix.
BEGIN {FS =
"="
|
Please observe that newline (\n) has two backslashes. Remember that we're working in Unix.
How to run this
1.- Just place this program and name it with anyname.awk
2.- Execute the following command at the prompt:
# set | awk -f anyname.awk > /tmp/rpvqueue/settings.rpv
| Please note that the output of awk is a file placed in /tmp/rpvqueue. That will be the queue directory and the server must be active and searching there. |
Something better you can do.
# set | awk -f anyname.awk > settings.rpv;mv settings.rpv /tmp/rpvqueue
In this case we're generating the file first and after that we're moving it to the queue directory. This would be the proper way.