fn: mve
[contents]

Contents

Syntax

The syntax for mve calls is:

f++:  
mve(sources, target)
mve sources target

n++:  
@mve(sources, target)
@mve sources target

Description

mve is the move function, it moves the files and/or directories specified by the sources parameters to the target specified in the trailing parameter. For more than one source the target should be an existing dirctory, for a single source the target can be either an existing directory or a file to move to.

Note: Paths can be unoquoted, single quoted or double quoted.

Note: You should also be able to use the move function for the underlying shell as well, typically move on Windows and mv on other platforms like FreeBSD, Linux, OSX, etc..

Note: Nift will skip to the first non-whitespace (ie. to the first character that is not a space, tab or newline) after a mve call and inject it to the output file where the call started. If you want to prevent Nift from doing this put a '!' after the call, eg.:

@mve dir1 dir2;!
@mve(dir1, dir2)!

Options

The following options are available for mve calls:

option description
b backup files to be replaced
f ensures files have write permission before trying to overwrite them
i prompt when moving files
n do not overwrite existing files
T treat target as a file rather than a directory
u only overwrite files if file to replace is newer
v output which files are being moved and where (verbose)
option description

f++ example

Examples of mve being used with f++:

mve("sample.txt", "sample1.txt")
mve dir1 dir2 dir3
mve{u} *.txt dir

n++ example

Example of mve being used with n++:

@mve("sample.txt", "sample1.txt")
@mve dir1 dir2 dir3
@mve{u} *.txt dir