ACC SHELL
/**
* File:
* run_df.scr
* Summary:
* SCR Agent for reading the result from /bin/df -P
* Access:
* read-only
* Authors:
* Unknown <yast2-hacker@suse.de>
* See:
* anyagent
* libscr
* man df
* Example:
* Read(.run.df)
* ([$["dummy":"on",
* "free":"Available",
* "name":"Mounted",
* "prz":"Capacity",
* "spec":"Filesystem",
* "used":"Used",
* "whole":"1024-blocks"],
* $["free":"2170396",
* "name":"/",
* "prz":"75%",
* "spec":"/dev/sda3",
* "used":"6496372",
* "whole":"8666768"],
* $["free":"18715",
* "name":"/boot",
* "prz":"16%",
* "spec":"/dev/sda1",
* "used":"3382",
* "whole":"23300"],
* ])
*
* $Id: run_df.scr 47005 2008-04-23 15:19:35Z locilka $
*
* Returns a <b>list of maps</b>. Each map (list-entry) corresponds
* with one mount.
* Keys for the maps are: "spec", "whole", "used", "free", "prz", "name",
* "dummy"
*/
.run.df
`ag_anyagent(
`Description (
(`Run("/bin/df -P 2>/dev/null")), // real file name
"\n", // Comment
true, // read-only
(`List (
`Tuple (
`spec (`String("^\t ")),
`Separator ("\t "),
`whole (`String("^\t ")),
`Separator ("\t "),
`used (`String("^\t ")),
`Separator ("\t "),
`free (`String("^ \t")),
`Separator ("\t "),
`prz (`String("^ \t")),
`Separator ("\t "),
`name (`String("^ \t\n")),
`Optional(`Whitespace()),
`Optional(`dummy (`String("^ \t\n")))
),
"\n"
))
)
)
ACC SHELL 2018