diff options
author | 2019-01-04 22:33:55 +0530 | |
---|---|---|
committer | 2019-01-04 22:33:55 +0530 | |
commit | 0617c8d90ab49dfcf0d7cefb0a7a6610d742d56e (patch) | |
tree | 66e9a743d30fea0fa8f8716be7c4dad7bb952388 /scripts/user-scripts | |
parent | 244ba9f953c8036f2c1dd17006baec81ce1fbb42 (diff) | |
download | nnn-0617c8d90ab49dfcf0d7cefb0a7a6610d742d56e.tar.gz |
Sample scripts to convert NUL to newline
Diffstat (limited to 'scripts/user-scripts')
-rwxr-xr-x | scripts/user-scripts/copier.sh | 2 | ||||
-rw-r--r-- | scripts/user-scripts/picker.sh | 16 |
2 files changed, 6 insertions, 12 deletions
diff --git a/scripts/user-scripts/copier.sh b/scripts/user-scripts/copier.sh index 3d8ccb5..391770c 100755 --- a/scripts/user-scripts/copier.sh +++ b/scripts/user-scripts/copier.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh # Linux cat ~/.nnncp | xargs -0 | xsel -bi diff --git a/scripts/user-scripts/picker.sh b/scripts/user-scripts/picker.sh index 1968c96..8885ed6 100644 --- a/scripts/user-scripts/picker.sh +++ b/scripts/user-scripts/picker.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env sh # Description: Pick files and pipe the line-separated list to another utility # -# Shell: bash +# Shell: sh # Author: Arun Prakash Jana # # Usage: @@ -16,12 +16,6 @@ # # NOTE: This use case is limited to picking files, other functionality may not work as expected. -nnn -p /tmp/pickerout -> /tmp/picked -while read -d $'\0' line ; do - echo $line >> /tmp/picked -done < /tmp/pickerout -echo $line >> /tmp/picked -cat /tmp/picked - -rm /tmp/pickerout /tmp/picked +nnn -p /tmp/picked +cat /tmp/picked | tr '\0' '\n' +rm /tmp/picked |