From 0617c8d90ab49dfcf0d7cefb0a7a6610d742d56e Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 4 Jan 2019 22:33:55 +0530 Subject: Sample scripts to convert NUL to newline --- scripts/user-scripts/copier.sh | 2 +- scripts/user-scripts/picker.sh | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'scripts/user-scripts') 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 -- cgit v1.2.3-70-g09d2