From c715f933ca179b630d0a4e34a86db5401ed994bf Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 27 Sep 2024 10:35:32 +0300 Subject: [PATCH] Unify redirection operator usage --- anchors/dns/@.do | 2 +- bin/bin/mkss | 2 +- bin/bin/mv-hsh | 2 +- bin/bin/my-scan | 6 +++--- bin/bin/www | 2 +- bin/bin/zsnap | 4 ++-- gnupg/bin/mk-wkd-keys | 4 ++-- img/bin/my-jxll | 4 ++-- link-for/bin/link-for-github-release | 6 +++--- mkv/bin/my-mkvmerge | 4 ++-- mutt/.mutt/muttrc | 2 +- nnn/bin/_nnn-cd | 2 +- nnn/bin/_nnn-cp | 2 +- tmux/.tmux/bin/fzf.zsh | 2 +- vim/bin/qq | 2 +- x/bin/dwm-menu | 2 +- x/bin/start-tabbed.sh | 4 ++-- zsh/.zsh/rc/010mime.zsh | 8 ++++---- zsh/.zsh/rc/020zhashd.zsh | 2 +- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/anchors/dns/@.do b/anchors/dns/@.do index 248c5f5..0674666 100644 --- a/anchors/dns/@.do +++ b/anchors/dns/@.do @@ -1,5 +1,5 @@ redo-ifchange root-servers.net.zone -perl -lane 'print $F[$#F] if $F[3] =~ /^AA?/' < root-servers.net.zone | +perl -lane 'print $F[$#F] if $F[3] =~ /^AA?/' $tmp.txt + paster $tmp.webp >$tmp.txt fi xmessage -file $tmp.txt diff --git a/bin/bin/mv-hsh b/bin/bin/mv-hsh index fe7ee92..546ba81 100755 --- a/bin/bin/mv-hsh +++ b/bin/bin/mv-hsh @@ -2,5 +2,5 @@ [ $# -eq 0 ] && fs="$(find . -maxdepth 1 -type f)" || fs="$@" for f in $fs ; do - mv -v "$f" $(b3sum < "$f").${f##*.} + mv -v "$f" $(b3sum <"$f").${f##*.} done diff --git a/bin/bin/my-scan b/bin/bin/my-scan index 083c089..b928280 100755 --- a/bin/bin/my-scan +++ b/bin/bin/my-scan @@ -23,7 +23,7 @@ scan() { --progress \ --resolution=$resolution \ --source="$src" \ - $@ > tmp.ppm + $@ >tmp.ppm } process() { @@ -33,7 +33,7 @@ process() { } preview() { - process < tmp.ppm | pamdepth 255 | pnmscale -w 600 > preview.ppm + process preview.ppm sxiv preview.ppm } @@ -62,7 +62,7 @@ while : ; do preview ;; n) - cat tmp.ppm | process > $cur + cat tmp.ppm | process >$cur do_next ;; r) diff --git a/bin/bin/www b/bin/bin/www index 86d9102..2f71c08 100755 --- a/bin/bin/www +++ b/bin/bin/www @@ -6,7 +6,7 @@ term() { DISPLAY=:0 CMD="tmux attach-session -t www" CMDTITLE="Terminal9" $HOME/bin/dwm-term & } -if tmux has-session -t www 2> /dev/null ; then +if tmux has-session -t www 2>/dev/null ; then attached=`tmux list-sessions -F "#{session_attached}" -f "#{==:#{session_name},www}"` [ "$attached" != "0" ] || { term & diff --git a/bin/bin/zsnap b/bin/bin/zsnap index 207f820..07ca3c8 100755 --- a/bin/bin/zsnap +++ b/bin/bin/zsnap @@ -52,7 +52,7 @@ case $action in [[ -d $dst ]] || usage mk_fifo setopt PIPE_FAIL - zfs send -Rwv $latest | zstdmt | $enccmd > $dst/$latest_filename.zfs.zst.age + zfs send -Rwv $latest | zstdmt | $enccmd >$dst/$latest_filename.zfs.zst.age sync touch $dst/$latest_filename.from ;; @@ -70,7 +70,7 @@ case $action in $dst/$latest_filename.zfs.zst.age set +x sync - print $latest_dst > $dst/$latest_filename.from + print $latest_dst >$dst/$latest_filename.from ;; clean) count=$3 diff --git a/gnupg/bin/mk-wkd-keys b/gnupg/bin/mk-wkd-keys index b09508e..5be7cf3 100755 --- a/gnupg/bin/mk-wkd-keys +++ b/gnupg/bin/mk-wkd-keys @@ -4,5 +4,5 @@ email=$1 shift hsh=`gpg-wks-client --print-wkd-hash $email | cut -d " " -f1` -gpg --export $@ > $hsh -gpg --armor --export $@ > $hsh.asc +gpg --export $@ >$hsh +gpg --armor --export $@ >$hsh.asc diff --git a/img/bin/my-jxll b/img/bin/my-jxll index cd6ee12..7be7f83 100755 --- a/img/bin/my-jxll +++ b/img/bin/my-jxll @@ -5,8 +5,8 @@ tmp=`mktemp` trap "rm -f $tmp.pnm $tmp.jxl" HUP PIPE INT QUIT TERM EXIT case $1:e in pnm) cp $1 $tmp.pnm ;; -gif) giftopnm < $1 > $tmp.pnm ;; -png) pngtopnm < $1 > $tmp.pnm ;; +gif) giftopnm <$1 >$tmp.pnm ;; +png) pngtopnm <$1 >$tmp.pnm ;; webp) dwebp -mt -quiet -o $tmp.pnm $1 ;; *) print unknown extension >&2 diff --git a/link-for/bin/link-for-github-release b/link-for/bin/link-for-github-release index bdac02f..10bf57f 100755 --- a/link-for/bin/link-for-github-release +++ b/link-for/bin/link-for-github-release @@ -2,6 +2,6 @@ tmp=`mktemp` trap "rm $tmp" HUP PIPE INT QUIT TERM EXIT -curl https://api.github.com/repos/${1}/${2}/releases > $tmp -gojq -r ".[] | .assets[] | .browser_download_url" < $tmp -gojq -r ".[] | .tarball_url" < $tmp +curl https://api.github.com/repos/${1}/${2}/releases >$tmp +gojq -r ".[] | .assets[] | .browser_download_url" <$tmp +gojq -r ".[] | .tarball_url" <$tmp diff --git a/mkv/bin/my-mkvmerge b/mkv/bin/my-mkvmerge index 5bf907f..3808ac6 100755 --- a/mkv/bin/my-mkvmerge +++ b/mkv/bin/my-mkvmerge @@ -9,10 +9,10 @@ trap "rm -f $tags" HUP PIPE INT QUIT TERM EXIT tagsopt=(--global-tags $tags) } [[ -z ${info[-descr]} ]] || { - txt=`xml esc < ${info[-descr]}` + txt=`xml esc <${info[-descr]}` descrTag="DESCRIPTION$txt" tagsopt=(--global-tags $tags) } -printf "\n%s\n%s\n" $urlTag $descrTag > $tags +printf "\n%s\n%s\n" $urlTag $descrTag >$tags mkvmerge --no-date --disable-track-statistics-tags $tagsopt --output ${info[-out]} $@ mkvpropedit --set muxing-application=- --set writing-application=- ${info[-out]} diff --git a/mutt/.mutt/muttrc b/mutt/.mutt/muttrc index e22e916..2f286ec 100644 --- a/mutt/.mutt/muttrc +++ b/mutt/.mutt/muttrc @@ -26,7 +26,7 @@ set forward_format = "Fwd: %s" set date_format = "%Y-%m-%d %H:%M" set index_format = "%4C %Z[%1H] %D [%N] %-15.15L (%?l?%4l&%4c?)%?M?[#%02M]?%?Y?[%Y]? %s" set pipe_decode = yes -set print_command = "cat > /tmp/mail-printed" +set print_command = "cat >/tmp/mail-printed" set attribution = "*** %n [%{%Y-%m-%d %H:%M}]:" set forward_attribution_intro = "----- BEGIN %i -----" set forward_attribution_trailer = "----- END %i -----" diff --git a/nnn/bin/_nnn-cd b/nnn/bin/_nnn-cd index 5ee8075..1138cdf 100755 --- a/nnn/bin/_nnn-cd +++ b/nnn/bin/_nnn-cd @@ -4,4 +4,4 @@ setopt ERR_EXIT [[ -n "$NNN_PIPE" ]] autoload ~/.zsh/functions/cf cf $1 -print -n -- "0c$PWD" > "$NNN_PIPE" +print -n -- "0c$PWD" >"$NNN_PIPE" diff --git a/nnn/bin/_nnn-cp b/nnn/bin/_nnn-cp index 86f424c..c5fbcc1 100755 --- a/nnn/bin/_nnn-cp +++ b/nnn/bin/_nnn-cp @@ -3,7 +3,7 @@ setopt ERR_EXIT sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} [[ -s $sel ]] -tgts=$(xargs -0 -L1 < $sel) +tgts=$(xargs -0 -L1 <$sel) tgts=(${(f)tgts}) size=$(du -A -c $tgts) size=(${=size}) diff --git a/tmux/.tmux/bin/fzf.zsh b/tmux/.tmux/bin/fzf.zsh index 06c91d5..587bdd5 100755 --- a/tmux/.tmux/bin/fzf.zsh +++ b/tmux/.tmux/bin/fzf.zsh @@ -6,7 +6,7 @@ fpath=(~/.tmux/functions.zsh $fpath) autoload tmux-fzf-$1 tmp=`mktemp` trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT -tmux-fzf-$1 > $tmp || { echo unknown command ; sleep 1 ; exit } +tmux-fzf-$1 >$tmp || { echo unknown command ; sleep 1 ; exit } [[ -s $tmp ]] || exit tmux set-buffer "`perl -npe 's/\n/ /g' $tmp`" tmux paste-buffer diff --git a/vim/bin/qq b/vim/bin/qq index 290f136..1ca6c91 100755 --- a/vim/bin/qq +++ b/vim/bin/qq @@ -4,7 +4,7 @@ tmp=`mktemp` tmux capture-pane -J tmux save-buffer $tmp tmux delete-buffer -perl -ne '/^([^:]+:\d+:.*[^\s])\s*$/ and print "$1\n"' < $tmp > $tmp.err +perl -ne '/^([^:]+:\d+:.*[^\s])\s*$/ and print "$1\n"' <$tmp >$tmp.err rm $tmp vim -c copen -q $tmp.err rm $tmp.err diff --git a/x/bin/dwm-menu b/x/bin/dwm-menu index 98c04ff..ac1f131 100755 --- a/x/bin/dwm-menu +++ b/x/bin/dwm-menu @@ -10,6 +10,6 @@ export PATH=$HOME/env/local/bin:$HOME/bin:$HOME/local/bin:/usr/local/bin:/usr/bi if $STEST -dqr -n "$cache" $PATH; then $STEST -flx $PATH | sort -u | tee "$cache" | $DMENU "$@" else - $DMENU "$@" < "$cache" + $DMENU "$@" <"$cache" fi ) | /bin/sh & diff --git a/x/bin/start-tabbed.sh b/x/bin/start-tabbed.sh index 7fbfe01..9b5a580 100755 --- a/x/bin/start-tabbed.sh +++ b/x/bin/start-tabbed.sh @@ -4,7 +4,7 @@ tabname=$1 shift w=/tmp/tabbed-$tabname [ -r "$w" ] && { - read winid < $w + read winid <$w wmclass=`xprop -id $winid WM_CLASS 2>/dev/null` echo "$wmclass" | grep -q tabbed-$tabname && { echo $winid @@ -12,6 +12,6 @@ w=/tmp/tabbed-$tabname } } [ -z "$NOTABSTART" ] || exit 1 -tabbed -n tabbed-$tabname -d $@ > $w +tabbed -n tabbed-$tabname -d $@ >$w sleep 0.1 exec $0 $tabname $@ diff --git a/zsh/.zsh/rc/010mime.zsh b/zsh/.zsh/rc/010mime.zsh index 221bdf7..cef4a49 100644 --- a/zsh/.zsh/rc/010mime.zsh +++ b/zsh/.zsh/rc/010mime.zsh @@ -5,10 +5,10 @@ mime_compressed_handler() { mv $tmp $tmp.$1:r:e tmp=$tmp.$1:r:e case $1:e in - (bz2) bunzip2 < $1 > $tmp ;; - (gz) gunzip < $1 > $tmp ;; - (xz) unxz < $1 > $tmp ;; - (zst) unzstd < $1 > $tmp ;; + (bz2) bunzip2 <$1 >$tmp ;; + (gz) gunzip <$1 >$tmp ;; + (xz) unxz <$1 >$tmp ;; + (zst) unzstd <$1 >$tmp ;; (*) exit 1 ;; esac zsh-mime-handler $tmp diff --git a/zsh/.zsh/rc/020zhashd.zsh b/zsh/.zsh/rc/020zhashd.zsh index 1f51fa6..a3ea80d 100644 --- a/zsh/.zsh/rc/020zhashd.zsh +++ b/zsh/.zsh/rc/020zhashd.zsh @@ -1,4 +1,4 @@ while read w ; do w=(${(s/=/)w}) hash -d ${w[1]}=${~${w[2]}} -done < ~/.zsh/hashd +done <~/.zsh/hashd -- 2.48.1