aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mischievous Meerkat <engineerarun@gmail.com>2019-08-15 19:06:28 +0530
committerGravatar GitHub <noreply@github.com>2019-08-15 19:06:28 +0530
commit2ee3b74b31aada25994f1f2ebc42ab465839c537 (patch)
tree2680294750d03f683916f63eebbe85d2176a5c35
parent9282eff925ca636ce673b3ed61b3bee9b8b6414a (diff)
parent7e47cd729b1183f029b8827a89b6c900b4a179ec (diff)
downloadnnn-2ee3b74b31aada25994f1f2ebc42ab465839c537.tar.gz
Merge pull request #325 from KlzXS/awk
Replacing last occurance of 'awk'
-rw-r--r--src/nnn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 109816a..6a25bdc 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1216,7 +1216,7 @@ static bool batch_rename(const char *path)
int fd1, fd2, i;
uint count = 0, lines = 0;
bool dir = FALSE, ret = FALSE;
- const char renamecmd[] = "awk 'FNR==NR{a[NR]=$0} a[FNR]!=$0{printf \"%%s\\0%%s\\0\",a[FNR],$0}' %s %s | xargs -0 -n2 mv 2>/dev/null";
+ const char renamecmd[] = "paste -d'\n' %s %s | sed 'N; /^\\(.*\\)\\n\\1$/!p;d' | tr '\n' '\\0' | xargs -0 -n2 mv 2>/dev/null";
char foriginal[TMP_LEN_MAX] = {0};
char buf[sizeof(renamecmd) + (PATH_MAX << 1)];