/usr/share/doc/runawk/examples/demo_runcmd is in runawk 1.5.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/usr/bin/env runawk
#use "runcmd.awk"
# Demo foir runcmd.awk module
BEGIN {
fn1 = "file name.txt"
fn2 = "~file&name'foobar'.txt"
xruncmd1("touch", "", fn1)
xruncmd1("echo", "foobar >", fn2)
xruncmd1("ls", "-1", fn1)
xruncmd1("ls", "", fn2)
ret = runcmd1("grep", "baz", fn2)
assert(1 == ret, "runcmd failed, exit status: " ret)
xruncmd1("rm", "-f", fn1)
xruncmd1("rm", "", fn2)
print "succeeded"
exit 0
}
|