wrfile

by Chris Kranz on Jul.07, 2009, under Manual Pages

Table of Contents

NAME

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 "../index.htm".   toaster> wrfile -a /etc/test1 "This is line '12'."   toaster> wrfile -a /etc/test1 'This is line "../index.htm".'   toaster> wrfile -a /etc/test1 This is line '"../index.htm"'.   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 "../index.htm".   This is line "../index.htm".   This is line "../index.htm".

SEE ALSO

rdfile

WARNINGS

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


Table of Contents

 

Copyright © 1994-2008 NetApp, Inc. Legal Information

VN:F [1.9.11_1134]
Rate this post:
Rating: 0.0/10 (0 votes cast)

:, , , ,

4 Comments for this entry

  • John Chiodo

    Can you explain what kind of sentence this is :

    ‘….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….’

    You’ve got to be kidding me right? What is that supposed to mean???

  • Chris Kranz

    Not sure what extra clarification you need on that. Having full root access to any system is dangerous and there are worse commands than this, but potentially with the wrfile you can do a lot of damage. It’d be difficult to do this accidentally, and that’s what snapshots are for.

    On the flip side, this could be useful in some scenarios where permissions are messed up or you need to quickly change a system file and you have no other access to the system.

  • Paul

    I think if the word AND is swapped for the word CAN, this will make sense. See below.

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

    And yes, having root access to anything is dangerous. I should know, I’ve broken enough stuff in my time.

  • Chris Kranz

    Thank you for the correction, I’ll update accordingly :)

Leave a Reply

Bad Behavior has blocked 38030 access attempts in the last 7 days.

© 2009-2012 Chris Kranz All Rights Reserved
This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.