logo

Manual Pages


Table of Contents

NAME

na_wrfile - write a WAFL file

SYNOPSIS

wrfile [-a] filename [...]

DESCRIPTION

wrfile reads data from standard input and writes it the specified file. filename must be a fully-qualified pathname. If the specified file does not exist, it will be created. If the -a parameter is given, wrfile will append the rest of the command line after filename to the file. Otherwise, it will close the file when it reads an EOF from the input stream or if run on the console, when interrupted by typing the interrupt character.

If wrfile is run from the console, interrupting wrfile will cause all characters typed on the same line as the interrupt to be lost. The filer will also issue a message complaining that the read system call was interrupted.

EXAMPLE

  toaster> wrfile /etc/test1
  test1
  read: error reading standard input: Interrupted system call
  toaster> wrfile -a /etc/test1 test2
  toaster>

creates a file /etc/test1 with two lines "test1" and "test2" in it.

The wrfile -a form has some restrictions with the use special charaters, #, `, and ". It is recommend that the line to be written parameter be surrounded by quotes. Please see the examples below for clarification.

  toaster> wrfile -a /etc/test1 This is line 2
  toaster> wrfile -a /etc/test1 This is line 3
  toaster> wrfile -a /etc/test1 This is line 4 with a \t
  toaster> wrfile -a /etc/test1 This is line 5 with a -v
  toaster> wrfile -a /etc/test1 This is line 6 # comment here
  toaster> wrfile -a /etc/test1 "This is line 7 # comment here"
  toaster> wrfile -a /etc/test1 This is line 8 with a slash n /n
  toaster> wrfile -a /etc/test1 This is line 9 with [] brackets
  toaster> wrfile -a /etc/test1 This is line '10'.
  toaster> wrfile -a /etc/test1 This is line "11".
  toaster> wrfile -a /etc/test1 "This is line '12'."
  toaster> wrfile -a /etc/test1 'This is line "13".'
  toaster> wrfile -a /etc/test1 This is line '"14"'.
  toaster> wrfile -a /etc/test1 "This is line \"15\"."

Will produce this file:

  toaster> rdfile /etc/test1
  This is line 2
  This is line 3
  This is line 4 with a \t
  This is line 5 with a -v
  This is line 6
  This is line 7 # comment here
  This is line 8 with a slash n /n
  This is line 9 with [] brackets
  This is line 10.
  This is line 11.
  This is line '12'.
  This is line "13".
  This is line "14".
  This is line "15".

SEE ALSO

rdfile(1)

WARNINGS

If a user has the capability to execute the wrfile command, then the user and write over or append onto any file on the filer.


Table of Contents