![]() |
![]()
| ![]() |
![]()
NAMEnbdkit-eval-plugin - write a shell script plugin on the command line SYNOPSISnbdkit eval get_size='SCRIPT' pread='SCRIPT' pwrite='SCRIPT' [...] DESCRIPTION"nbdkit-eval-plugin" is an nbdkit(1) plugin which allows you to write custom plugins as shell scripts snippets ‘eval’d on the command line. A common alternative to this plugin is nbdkit-sh-plugin(1). Both plugins share the same source code and work in almost the same way. You should read nbdkit-sh-plugin(1) first. It is easier to describe the differences between the two plugins and look at the examples below.
EXAMPLESCreate a 64M read-only disk of zeroes: nbdkit eval get_size=' echo 64M ' \ pread=' dd if=/dev/zero count=$3 iflag=count_bytes ' The following command is the eval plugin equivalent of nbdkit-file-plugin(1) (except not as fast and missing many features): nbdkit eval \ config='ln -sf "$(realpath "$3")" $tmpdir/file' \ get_size='stat -Lc %s $tmpdir/file' \ pread='dd if=$tmpdir/file skip=$4 count=$3 iflag=count_bytes,skip_bytes' \ pwrite='dd of=$tmpdir/file seek=$4 conv=notrunc oflag=seek_bytes' \ file=disk.img PARAMETERS
ENVIRONMENT VARIABLES
FILES
VERSION"nbdkit-eval-plugin" first appeared in nbdkit 1.18. SEE ALSOnbdkit(1), nbdkit-plugin(3), nbdkit-sh-plugin(1). AUTHORSRichard W.M. Jones COPYRIGHTCopyright (C) 2019 Red Hat Inc. LICENSERedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|