lib/reports.cf

Table of Contents

printfile bodies

cat

Prototype: cat(file)

Description: Report the contents of a file

Arguments:

  • file: The full path of the file to report

Implementation:

body printfile cat(file)
{
        file_to_print => "$(file)";
        number_of_lines => "inf";
}

Prototype: head(file)

Description: Report the first 10 lines of a file

Arguments:

  • file: The full path of the file to report

Implementation:

body printfile head(file)
{
        file_to_print => "$(file)";
      # GNU head defaults to 10, but we start counting from 0
        number_of_lines => "10";
}

head_n

Prototype: head_n(file, n)

Description: Report the first 10 lines of a file

Arguments:

  • file: The full path of the file to report
  • n: The number of lines to report

Implementation:

body printfile head_n(file, n)
{
        file_to_print => "$(file)";
        number_of_lines => "$(n)";
}