From 50bbd00de6fde11f1f2eceba08ccb2029e960114 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 17 May 2024 11:31:52 +0200 Subject: fish: fix newest/oldest with POSIX `cut` --- user/settings/fish/functions/newest.fish | 6 +++--- user/settings/fish/functions/oldest.fish | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'user/settings/fish') diff --git a/user/settings/fish/functions/newest.fish b/user/settings/fish/functions/newest.fish index 645e0d9f..73e26dcc 100644 --- a/user/settings/fish/functions/newest.fish +++ b/user/settings/fish/functions/newest.fish @@ -5,8 +5,8 @@ function newest end for arg in $argv fd --hidden --print0 --max-depth 1 . $arg | - bfs -files0-from - \( -name .git -prune \) -o \( -printf '%TY%Tm%Td%TR %TF %h/%f\0' \) | - sort --zero-terminated --reverse --key 1n,1 | head --zero-terminated --lines 1 | - cut --delimiter ' ' --fields 2,3 + bfs -files0-from - \( -name .git -prune \) -o \( -printf '%TY%Tm%Td%TR %TF %h/%f\n' \) | + sort --reverse --key 1n,1 | head --lines 1 | + cut -d ' ' -f 2,3 end end diff --git a/user/settings/fish/functions/oldest.fish b/user/settings/fish/functions/oldest.fish index 26d53c0f..66aad720 100644 --- a/user/settings/fish/functions/oldest.fish +++ b/user/settings/fish/functions/oldest.fish @@ -5,8 +5,8 @@ function oldest end for arg in $argv fd --hidden --print0 --max-depth 1 . $arg | - bfs -files0-from - \( -name .git -prune \) -o \( -printf '%TY%Tm%Td%TR %TF %h/%f\0' \) | - sort --zero-terminated --key 1n,1 | head --zero-terminated --lines 1 | - cut --delimiter ' ' --fields 2,3 + bfs -files0-from - \( -name .git -prune \) -o \( -printf '%TY%Tm%Td%TR %TF %h/%f\n' \) | + sort --key 1n,1 | head --lines 1 | + cut -d ' ' -f 2,3 end end -- cgit 1.4.1