bin: tweak flags

This commit is contained in:
xeruf 2021-05-07 12:31:14 +02:00
parent 38793e709b
commit 5dce61fb45
4 changed files with 9 additions and 4 deletions

View File

@ -6,7 +6,7 @@ alias -g G="| grp"
alias -g X="| xargs" alias -g X="| xargs"
alias -g X1="| xargs -n 1" alias -g X1="| xargs -n 1"
alias -g XC="| xclip -selection clipboard" alias -g XC="| xclip -selection clipboard"
alias -g L="--color=always | less" alias -g L="--color=always | ${PAGER:-less}"
fi fi
alias info='info --vi-keys' alias info='info --vi-keys'

View File

@ -12,5 +12,5 @@ case "$(file --dereference --mime "$last")" in
*inode/directory*) ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";; *inode/directory*) ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";;
*binary) ;; *binary) ;;
*) $(test -f "$last" -a ! -r "$last" && echo "sudo") bat --style header "$@" *) $(test -f "$last" -a ! -r "$last" && echo "sudo") bat --style header "$@"
stat -c '%A size %sB, birth: %.10w mod %.10y' "$last";; stat --format '%A size %sB, birth: %.10w mod %.10y' "$last";;
esac esac

View File

@ -12,7 +12,7 @@ for arg do
*.tar) tar xf "$arg" ;; *.tar) tar xf "$arg" ;;
*.tbz2) tar xjf "$arg" ;; *.tbz2) tar xjf "$arg" ;;
*.tgz) tar xzf "$arg" ;; *.tgz) tar xzf "$arg" ;;
*.zip) unzip "$arg" ;; *.zip|*.jar) unzip "$arg" ;;
*.Z) uncompress "$arg";; *.Z) uncompress "$arg";;
*.7z) 7z x "$arg" ;; *.7z) 7z x "$arg" ;;
*.deb) ar x "$arg" ;; *.deb) ar x "$arg" ;;

View File

@ -1,7 +1,12 @@
#!/bin/sh #!/bin/sh
stats() {
stat --format '%n %A size %sB, birth: %.10w mod %.10y' "$@"
}
if test "$#" -gt 0 if test "$#" -gt 0
then then
dif "$(st-unarchive "$1")" "$@" orig="$(st-unarchive "$1")"
( stats "$orig" "$1"; dif "$orig" "$@" ) |
less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen
test "$?" -eq "2" && exit 1 test "$?" -eq "2" && exit 1
echo "y|r to restore, n|d to delete" echo "y|r to restore, n|d to delete"
read reply read reply