summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2024-05-17 11:31:52 +0200
committerAlan Pearce2024-05-17 11:32:18 +0200
commit50bbd00de6fde11f1f2eceba08ccb2029e960114 (patch)
treedb7dde517b23f601dc4ca049486aedbbcdc7b4b0 /user
parentb76008ec6b5f50ee06e636ada50a71076a822cf5 (diff)
downloadnixfiles-50bbd00de6fde11f1f2eceba08ccb2029e960114.tar.lz
nixfiles-50bbd00de6fde11f1f2eceba08ccb2029e960114.tar.zst
nixfiles-50bbd00de6fde11f1f2eceba08ccb2029e960114.zip
fish: fix newest/oldest with POSIX `cut`
Diffstat (limited to 'user')
-rw-r--r--user/settings/fish/functions/newest.fish6
-rw-r--r--user/settings/fish/functions/oldest.fish6
2 files changed, 6 insertions, 6 deletions
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