To use `nnn` as a file picker and redirect the output to other programs, use [picker.sh](https://github.com/jarun/nnn/blob/master/scripts/user-scripts/picker.sh).
+Ways to pick files:
+
+- use selection and press <kbd>q</kbd> to quit
+- press <kbd>Enter</kbd> to pick any earlier selection and the current entry (to avoid selecting the last file in the selection twice, press <kbd>q</kbd> instead).
+
+Notes:
+
+- pressing <kbd>Enter</kbd> on a directory enters it; when trying to pick a directory, e.g. to pipe to `cd`, use single file selection and press <kbd>q</kbd>
+- to discard selection and quit, press <kbd>^G</kbd>
+
#### run custom scripts
`nnn` can invoke custom scripts with the currently selected file name as argument 1.
# Description: Pick files and pipe the line-separated list to another utility
#
-# Shell: sh
+# Shell: generic
# Author: Arun Prakash Jana
#
# Usage:
# NOTE: This use case is limited to picking files, other functionality may not work as expected.
nnn -p /tmp/picked
-cat /tmp/picked | tr '\0' '\n'
-rm /tmp/picked
+
+if [ -f /tmp/picked ]; then
+ cat /tmp/picked | tr '\0' '\n'
+ rm /tmp/picked
+fi