Эх сурвалжийг харах

use bash debugger to generate original command line with correct shell escaping for copy paste and reverse sort of listing so most recent is last

Daniel Sheffield 2 сар өмнө
parent
commit
968c5161f0
2 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 1 1
      capture.sh
  2. 1 1
      recall.sh

+ 1 - 1
capture.sh

@@ -23,7 +23,7 @@ OUT="$LOG_DIR"/stdout
 ERR="$LOG_DIR"/stderr
 DAT="$LOG_DIR"/dat
 INF="$LOG_DIR"/info
-CMD="$@"
+CMD="$( (set -x; : "$@") 2>&1 | cut -d: -f2- | cut -d' ' -f2-)"
 
 info(){
 	cat <<EOF > "$INF"

+ 1 - 1
recall.sh

@@ -171,7 +171,7 @@ then
 				\) \
 			\) \
 			-print0 \
-		| sort -zV \
+		| sort -zrV \
 		| head -zn "${NUM:--0}" \
 		| fzf_rw0_inplace_preview "${fzf_query[@]}" \
 		| awk_rw0_strip_first_path_part \