]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Unify redirection operator usage
authorSergey Matveev <stargrave@stargrave.org>
Fri, 27 Sep 2024 07:35:32 +0000 (10:35 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 27 Sep 2024 07:40:34 +0000 (10:40 +0300)
19 files changed:
anchors/dns/@.do
bin/bin/mkss
bin/bin/mv-hsh
bin/bin/my-scan
bin/bin/www
bin/bin/zsnap
gnupg/bin/mk-wkd-keys
img/bin/my-jxll
link-for/bin/link-for-github-release
mkv/bin/my-mkvmerge
mutt/.mutt/muttrc
nnn/bin/_nnn-cd
nnn/bin/_nnn-cp
tmux/.tmux/bin/fzf.zsh
vim/bin/qq
x/bin/dwm-menu
x/bin/start-tabbed.sh
zsh/.zsh/rc/010mime.zsh
zsh/.zsh/rc/020zhashd.zsh

index 248c5f5dff673eb7de00fee56945cbfbe4f18aa0..0674666cf0afd10608386e88df67d3d45c6f63d4 100644 (file)
@@ -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?/' <root-servers.net.zone |
 while read addr ; do
     [ "${addr#*:}" = "$addr" ] && echo $addr ||
         sipcalc $addr | perl -lane 'print $F[$#F] if /^Compressed address/'
index a276498b21e743112020b74b3f22a6faca5eabc2..5182b3aadf7ec1a319a7ac7bf9a2f1d9c29b10be 100755 (executable)
@@ -14,6 +14,6 @@ if [ "$1" = no ]; then
     mv $tmp.webp $fn
     echo $fn | tee $tmp.txt
 else
-    paster $tmp.webp > $tmp.txt
+    paster $tmp.webp >$tmp.txt
 fi
 xmessage -file $tmp.txt
index fe7ee9259ea708f261a38f872b4fb1cf638a08e4..546ba813d204dc44555cda8d01288174556ce29f 100755 (executable)
@@ -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
index 083c08902952afb8af31a607bc53b2ab76779f8a..b928280fba6112f39fb50e4a594bd75bafa91674 100755 (executable)
@@ -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 <tmp.ppm | pamdepth 255 | pnmscale -w 600 >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)
index 86d910255fe1b33c29878f05fb068809cda2122f..2f71c084da36f582d601deddd6c5f47fa8b3da5f 100755 (executable)
@@ -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 &
index 207f8202a53898aa9d72b02729c2ba41dc4abf70..07ca3c816f8985f218a6e83f06109ac9e1d25473 100755 (executable)
@@ -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
index b09508e7dcd8ca5c8a9c6dee16fe1da061d5927c..5be7cf3cd659d5c69d5c3b9bf71aab111ca510c8 100755 (executable)
@@ -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
index cd6ee12b66baab2ada9b017665b7bc9f28b1ff8a..7be7f837c504bab7da1894ed52608e0d0f92f230 100755 (executable)
@@ -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
index bdac02f5970ae2ccf65ad36d54620827722b74b6..10bf57f4739fa353ac5c770877182975b3fba6af 100755 (executable)
@@ -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
index 5bf907f10f43541e8543a3e643eb3d5b56f6ec32..3808ac63501a39a73dff06d967abc8a0cb34dbed 100755 (executable)
@@ -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="<Tag><Simple><Name>DESCRIPTION</Name><String>$txt</String></Simple></Tag>"
     tagsopt=(--global-tags $tags)
 }
-printf "<Tags>\n%s\n%s\n</Tags>" $urlTag $descrTag > $tags
+printf "<Tags>\n%s\n%s\n</Tags>" $urlTag $descrTag >$tags
 mkvmerge --no-date --disable-track-statistics-tags $tagsopt --output ${info[-out]} $@
 mkvpropedit --set muxing-application=- --set writing-application=- ${info[-out]}
index e22e9160a1e8713ecb9cb30ffec20bb6a2485c50..2f286ec305382c7c2f5cc38df56833ce9d8d389b 100644 (file)
@@ -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 -----"
index 5ee80756e7b998bd58a5a4a70d846da14b1ff068..1138cdf622e3807e90b9068c637c749ca0a9351c 100755 (executable)
@@ -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"
index 86f424c400d8bd7ff1c9aa7ae070e1050d27435c..c5fbcc19bcf821854809eee40416e1953d62b8df 100755 (executable)
@@ -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})
index 06c91d5134b0c6e9b76388711df8d55ed43579dc..587bdd5c1d6c18c491861bbadb0010da89587359 100755 (executable)
@@ -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
index 290f13654e5cc492c287fd2fe6b0aa5f3b287707..1ca6c9127771db7c9c8747972a2e1561db348a33 100755 (executable)
@@ -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
index 98c04ff077c14fd089f4d30add090d3ed7f381a4..ac1f13144e8d04a5af15fab56a05206b52b64bb1 100755 (executable)
@@ -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 &
index 7fbfe019eac8b59eb88a85c77dbeb84ffd7f61a9..9b5a580537ed58b0f0be783262bed6a6f740229e 100755 (executable)
@@ -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 $@
index 221bdf7cbc73a2435fcfe066768e19bc41a28689..cef4a49fca732965c13483e445a8f45b4de755f5 100644 (file)
@@ -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
index 1f51fa664b004339056515b2194043219f2f4412..a3ea80df81bfc23d41a7a392ca74e2b916085133 100644 (file)
@@ -1,4 +1,4 @@
 while read w ; do
     w=(${(s/=/)w})
     hash -d ${w[1]}=${~${w[2]}}
-done < ~/.zsh/hashd
+done <~/.zsh/hashd