From: Sergey Matveev Date: Tue, 23 Jul 2024 09:14:18 +0000 (+0300) Subject: Unify redirection operator usage X-Git-Tag: v8.11.0^2~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8bd673cf914475f332722fb12ac4a18377cf0d43;p=nncp.git Unify redirection operator usage --- diff --git a/doc/admin.texi b/doc/admin.texi index 47e0e3e..dcb6b18 100644 --- a/doc/admin.texi +++ b/doc/admin.texi @@ -44,7 +44,7 @@ NNCP uses following files/directories you should be aware of: $ chgrp nncp /usr/local/etc/nncp.hjson /var/spool/nncp $ chmod g+r /usr/local/etc/nncp.hjson $ chmod g+rwxs /var/spool/nncp -$ echo 'umask: "007"' >> /usr/local/etc/nncp.hjson +$ echo 'umask: "007"' >>/usr/local/etc/nncp.hjson @end example @item @@ -84,13 +84,13 @@ $ echo 'umask: "007"' >> /usr/local/etc/nncp.hjson # mkdir -p /var/service/.nncp-toss/log # cd /var/service/.nncp-toss -# cat > run <run <&1 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10 EOF -# cat > log/run <log/run < run <run <&1 EOF -# cat > log/run <log/run < @dots{} -$ nncp-bundle [options] -rx -delete [-dryrun] [NODE @dots{}] < @dots{} -$ nncp-bundle [options] -rx [-check] [-dryrun] [NODE @dots{}] < @dots{} +$ nncp-bundle [options] -tx [-delete] NODE [NODE @dots{}] >@dots{} +$ nncp-bundle [options] -rx -delete [-dryrun] [NODE @dots{}] <@dots{} +$ nncp-bundle [options] -rx [-check] [-dryrun] [NODE @dots{}] <@dots{} @end example With @option{-tx} option, this command creates @ref{Bundles, bundle} of diff --git a/doc/cmd/nncp-cfgdir.texi b/doc/cmd/nncp-cfgdir.texi index 0750ade..0ce48ca 100644 --- a/doc/cmd/nncp-cfgdir.texi +++ b/doc/cmd/nncp-cfgdir.texi @@ -4,7 +4,7 @@ @example $ nncp-cfgdir [options] [-cfg @dots{}] -dump /path/to/dir -$ nncp-cfgdir [options] -load /path/to/dir > cfg.hjson +$ nncp-cfgdir [options] -load /path/to/dir >cfg.hjson @end example @option{-dump} option dumps current configuration file to the diff --git a/doc/cmd/nncp-cfgenc.texi b/doc/cmd/nncp-cfgenc.texi index 02070c3..ec5aaee 100644 --- a/doc/cmd/nncp-cfgenc.texi +++ b/doc/cmd/nncp-cfgenc.texi @@ -3,8 +3,8 @@ @section nncp-cfgenc @example -$ nncp-cfgenc [options] [-s INT] [-t INT] [-p INT] cfg.hjson > cfg.hjson.eblob -$ nncp-cfgenc [options] -d cfg.hjson.eblob > cfg.hjson +$ nncp-cfgenc [options] [-s INT] [-t INT] [-p INT] cfg.hjson >cfg.hjson.eblob +$ nncp-cfgenc [options] -d cfg.hjson.eblob >cfg.hjson @end example This command allows you to encrypt provided @file{cfg.hjson} file with diff --git a/doc/cmd/nncp-cfgmin.texi b/doc/cmd/nncp-cfgmin.texi index 91043cb..32b2db2 100644 --- a/doc/cmd/nncp-cfgmin.texi +++ b/doc/cmd/nncp-cfgmin.texi @@ -5,7 +5,7 @@ @section nncp-cfgmin @example -$ nncp-cfgmin [options] > stripped.hjson +$ nncp-cfgmin [options] >stripped.hjson @end example Print out stripped configuration version: only path to @ref{Spool, diff --git a/doc/cmd/nncp-cfgnew.texi b/doc/cmd/nncp-cfgnew.texi index ccd47c6..9d14f9a 100644 --- a/doc/cmd/nncp-cfgnew.texi +++ b/doc/cmd/nncp-cfgnew.texi @@ -3,7 +3,7 @@ @section nncp-cfgnew @example -$ nncp-cfgnew [options] [-area NAME] [-yggdrasil] [-nocomments] > new.hjson +$ nncp-cfgnew [options] [-area NAME] [-yggdrasil] [-nocomments] >new.hjson @end example Generate new node configuration: private keys, example configuration diff --git a/doc/cmd/nncp-exec.texi b/doc/cmd/nncp-exec.texi index 8b9c753..0226351 100644 --- a/doc/cmd/nncp-exec.texi +++ b/doc/cmd/nncp-exec.texi @@ -19,7 +19,7 @@ node: @verbatim exec: { sendmail: [/usr/sbin/sendmail, "-t"] - appender: ["/bin/sh", "-c", "cat >> /append"] + appender: ["/bin/sh", "-c", "cat >>/append"] } @end verbatim diff --git a/doc/cmd/nncp-pkt.texi b/doc/cmd/nncp-pkt.texi index ab0495a..7f94478 100644 --- a/doc/cmd/nncp-pkt.texi +++ b/doc/cmd/nncp-pkt.texi @@ -3,8 +3,8 @@ @section nncp-pkt @example -$ nncp-pkt [options] < pkt -$ nncp-pkt [options] [-decompress] -dump < pkt > payload +$ nncp-pkt [options] payload $ nncp-pkt -overheads @end example diff --git a/doc/default.plantuml.txt.do b/doc/default.plantuml.txt.do index 917366a..5d86694 100644 --- a/doc/default.plantuml.txt.do +++ b/doc/default.plantuml.txt.do @@ -1,4 +1,4 @@ src=${1%.txt} redo-ifchange $src ../config . ../config -$PLANTUML -tutxt -pipe < $src +$PLANTUML -tutxt -pipe <$src diff --git a/doc/integration/freqindex.texi b/doc/integration/freqindex.texi index 68f5e27..b31515a 100644 --- a/doc/integration/freqindex.texi +++ b/doc/integration/freqindex.texi @@ -10,7 +10,7 @@ for files in it: @example 0 4 * * * cd /storage ; tmp=`mktemp` ; \ tree -f -h -N --du --timefmt \%Y-\%m-\%d | - zstdmt -19 > $tmp && chmod 644 $tmp && mv $tmp TREE.txt.zst ; \ + zstdmt -19 >$tmp && chmod 644 $tmp && mv $tmp TREE.txt.zst ; \ tree -J -f --timefmt \%Y-\%m-\%d | - zstdmt -19 > $tmp && chmod 644 $tmp && mv $tmp TREE.json.zst + zstdmt -19 >$tmp && chmod 644 $tmp && mv $tmp TREE.json.zst @end example diff --git a/doc/integrity.texi b/doc/integrity.texi index f09b5e8..739db18 100644 --- a/doc/integrity.texi +++ b/doc/integrity.texi @@ -38,7 +38,7 @@ $ gpg --auto-key-locate wkd --locate-keys releases at nncpgo dot org @example $ ssh-keygen -Y verify -f PUBKEY-SSH.pub -I releases@@nncpgo.org -n file \ - -s nncp-@value{VERSION}.tar.zst.sig < nncp-@value{VERSION}.tar.zst + -s nncp-@value{VERSION}.tar.zst.sig $tmp -sendmail -f "`reformail -x Return-Path: < $tmp`" $@ < $tmp +cat >$tmp +sendmail -f "`reformail -x Return-Path: <$tmp`" $@ <$tmp diff --git a/makedist b/makedist index 749e523..f0b84f1 100755 --- a/makedist +++ b/makedist @@ -9,7 +9,7 @@ release=$1 git clone . $tmp/nncp-$release cd $tmp/nncp-$release git checkout v$release -./version > VERSION +./version >VERSION cd src go mod vendor modvendor -v -copy="**/*_test.go **/words.go **/README.md **/main.go" @@ -36,7 +36,7 @@ find . \( \ -name .goreleaser.yml -o \ -name .gitattributes \) -delete -cat > doc/download.texi <doc/download.texi < $texi <$texi < $texi <$texi < $texi <$texi < $texi < $texi <$texi < "$tarball".meta4 + https://nncp.mirrors.quux.org/download/"$tarball" <"$tarball" >"$tarball".meta4 size=$(( $(stat -f %z $tarball) / 1024 )) release_date=$(date "+%Y-%m-%d") diff --git a/ports/nncp/files/pkg-message.in b/ports/nncp/files/pkg-message.in index de4eb3f..db579d8 100644 --- a/ports/nncp/files/pkg-message.in +++ b/ports/nncp/files/pkg-message.in @@ -15,7 +15,7 @@ - Generate NNCP configuration file using the command: # umask 077 - # nncp-cfgnew > %%PREFIX%%/etc/nncp.hjson + # nncp-cfgnew >%%PREFIX%%/etc/nncp.hjson EOM } ] diff --git a/src/cmd/nncp-bundle/main.go b/src/cmd/nncp-bundle/main.go index 4f82ff0..861d315 100644 --- a/src/cmd/nncp-bundle/main.go +++ b/src/cmd/nncp-bundle/main.go @@ -37,9 +37,9 @@ import ( func usage() { fmt.Fprint(os.Stderr, "nncp-bundle -- Create/digest stream of NNCP encrypted packets\n\n") - fmt.Fprintf(os.Stderr, "Usage: %s [options] -tx [-delete] NODE [NODE ...] > ...\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " %s [options] -rx -delete [-dryrun] [NODE ...] < ...\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " %s [options] -rx [-check] [-dryrun] [NODE ...] < ...\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s [options] -tx [-delete] NODE [NODE ...] >...\n", os.Args[0]) + fmt.Fprintf(os.Stderr, " %s [options] -rx -delete [-dryrun] [NODE ...] <...\n", os.Args[0]) + fmt.Fprintf(os.Stderr, " %s [options] -rx [-check] [-dryrun] [NODE ...] <...\n", os.Args[0]) fmt.Fprintln(os.Stderr, "Options:") flag.PrintDefaults() } diff --git a/src/cmd/nncp-cfgdir/main.go b/src/cmd/nncp-cfgdir/main.go index 2367740..66246d1 100644 --- a/src/cmd/nncp-cfgdir/main.go +++ b/src/cmd/nncp-cfgdir/main.go @@ -29,7 +29,7 @@ import ( func usage() { fmt.Fprint(os.Stderr, "nncp-cfgdir -- Convert configuration file to the directory layout.\n\n") fmt.Fprintf(os.Stderr, "Usage: %s [options] [-cfg ...] -dump /path/to/dir\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " %s [options] -load /path/to/dir > cfg.hjson\nOptions:\n", os.Args[0]) + fmt.Fprintf(os.Stderr, " %s [options] -load /path/to/dir >cfg.hjson\nOptions:\n", os.Args[0]) flag.PrintDefaults() } diff --git a/src/cmd/nncp-cfgenc/main.go b/src/cmd/nncp-cfgenc/main.go index a8559b1..305f669 100644 --- a/src/cmd/nncp-cfgenc/main.go +++ b/src/cmd/nncp-cfgenc/main.go @@ -32,8 +32,8 @@ import ( func usage() { fmt.Fprint(os.Stderr, "nncp-cfgenc -- encrypt/decrypt configuration file\n\n") - fmt.Fprintf(os.Stderr, "Usage: %s [options] cfg.hjson > cfg.hjson.eblob\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " %s [options] -d cfg.hjson.eblob > cfg.hjson\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s [options] cfg.hjson >cfg.hjson.eblob\n", os.Args[0]) + fmt.Fprintf(os.Stderr, " %s [options] -d cfg.hjson.eblob >cfg.hjson\n", os.Args[0]) fmt.Fprintf(os.Stderr, " %s [options] -dump cfg.hjson.eblob\n", os.Args[0]) fmt.Fprintln(os.Stderr, "Options:") flag.PrintDefaults() diff --git a/src/cmd/nncp-rm/main.go b/src/cmd/nncp-rm/main.go index 5f30905..c723c47 100644 --- a/src/cmd/nncp-rm/main.go +++ b/src/cmd/nncp-rm/main.go @@ -42,7 +42,7 @@ func usage() { fmt.Fprintf(os.Stderr, " %s [options] [-older X] {-all|-node NODE} -nock\n", os.Args[0]) fmt.Fprintf(os.Stderr, " %s [options] [-older X] {-all|-node NODE} -area\n", os.Args[0]) fmt.Fprintf(os.Stderr, " %s [options] [-older X] {-all|-node NODE} {-rx|-tx} [-hdr]\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " %s [options] {-all|-node NODE} -pkt < ...\n", os.Args[0]) + fmt.Fprintf(os.Stderr, " %s [options] {-all|-node NODE} -pkt <...\n", os.Args[0]) fmt.Fprintf(os.Stderr, " %s [options] {-all|-node NODE} -ack\n", os.Args[0]) fmt.Fprintln(os.Stderr, "-older option's time units are: (s)econds, (m)inutes, (h)ours, (d)ays") fmt.Fprintln(os.Stderr, "Options:") diff --git a/src/toss_test.go b/src/toss_test.go index 3ff63e0..6bdf3cf 100644 --- a/src/toss_test.go +++ b/src/toss_test.go @@ -122,7 +122,7 @@ func TestTossExec(t *testing.T) { ctx.Neigh[*nodeOur.Id].Exec[handle] = []string{ "/bin/sh", "-c", fmt.Sprintf( - "echo $NNCP_NICE $0 $1 >> %s ; cat >> %s", + "echo $NNCP_NICE $0 $1 >>%s ; cat >>%s", filepath.Join(spool, "mbox"), filepath.Join(spool, "mbox"), ), diff --git a/t/nncp-rm.t b/t/nncp-rm.t index aa7cc83..b264b14 100755 --- a/t/nncp-rm.t +++ b/t/nncp-rm.t @@ -46,13 +46,13 @@ assert_is_deleted() { } now=`date +%s` -nncp-cfgnew > cfg +nncp-cfgnew >cfg nncp-cfgdir -cfg cfg -dump cfgdir -echo "$PWD/spool" > cfgdir/spool -echo "$PWD/log" > cfgdir/log +echo "$PWD/spool" >cfgdir/spool +echo "$PWD/log" >cfgdir/log neigh=`rand32` mkdir -p cfgdir/neigh/neigh -for w in id exchpub signpub ; do echo $neigh > cfgdir/neigh/neigh/$w ; done +for w in id exchpub signpub ; do echo $neigh >cfgdir/neigh/neigh/$w ; done mkdir -p spool/tmp spool/$neigh/rx/hdr spool/$neigh/rx/seen spool/$neigh/tx/hdr date_old=$(date -j -f %s +%FT%T $(( $now - (3600 * 24 * 7) ))) diff --git a/version b/version index 7e6282e..c2dad69 100755 --- a/version +++ b/version @@ -1,3 +1,3 @@ #!/bin/sh -e -exec perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' < "$(realpath -- $(dirname "$0"))"/src/nncp.go +exec perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' <"$(realpath -- $(dirname "$0"))"/src/nncp.go