From 9b42d1c1e16c12e716059ecb5f454f2d360b41b9 Mon Sep 17 00:00:00 2001 From: shtayerc Date: Mon, 14 Oct 2024 20:18:53 +0200 Subject: [PATCH] Replace tac with awk to be more portable "tac" is GNU coreutils specific command - it is not present in bsd utils. There is also "tail -r", but the parameter is not POSIX compliant. --- distrobox-enter | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distrobox-enter b/distrobox-enter index 471142bfd6..2a2c653496 100755 --- a/distrobox-enter +++ b/distrobox-enter @@ -709,8 +709,8 @@ if [ "${unshare_groups:-0}" -eq 1 ]; then fi # Generate the exec command and run it -cmd="$(generate_enter_command | tac)" -# Reverse it with tac so we can reverse loop and prepend the command's arguments +cmd="$(generate_enter_command | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--]}')" +# Reverse it so we can reverse loop and prepend the command's arguments # to our positional parameters IFS=' '