#### run custom scripts
+`nnn` can invoke custom scripts with the currently selected file name as argument 1.
+
Export the path to the custom executable script:
export NNN_SCRIPT=/usr/local/bin/nscript
\fBNNN_QUOTE_ON:\fR wrap copied paths within single quotes. Useful for pasting
names in the shell.
.Pp
-\fBNNN_SCRIPT:\fR path to a custom script to run.
+\fBNNN_SCRIPT:\fR path to a custom script to invoke with currently selected file name as argument 1.
.Bd -literal
export NNN_SCRIPT=/usr/local/bin/nscript
.Ed
tmp = newpath;
}
- spawn(run, tmp, NULL, path, F_NORMAL | F_SIGINT);
+
+ char *curfile = NULL;
+ if (ndents > 0)
+ curfile = dents[cur].name;
+
+ spawn(run, tmp, curfile, path, F_NORMAL | F_SIGINT);
}
} else {
spawn(run, NULL, NULL, path, F_NORMAL | F_MARKER);