diff --git a/Makefile b/Makefile index 4658a1a..06d7c38 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ -CMD = blink bsearch G gitundo histogram upsidedown tracefile timestamp rand rclean rrm goodpasswd gitnext pdfman puniq ramusage ramusage +CMD = blink bsearch G gitnext goodpasswd histogram neno \ +pdfman puniq ramusage rand rclean rn rrm timestamp tracefile \ +upsidedown wssh -all: blink/blink.1 bsearch/bsearch.1 G/G.1 gitnext/gitnext.1 gitundo/gitundo.1 goodpasswd/goodpasswd.1 histogram/histogram.1 neno/neno.1 pdfman/pdfman.1 puniq/puniq.1 rand/rand.1 rrm/rrm.1 timestamp/timestamp.1 tracefile/tracefile.1 upsidedown/upsidedown.1 wssh/wssh.1 +all: blink/blink.1 bsearch/bsearch.1 G/G.1 gitnext/gitnext.1 goodpasswd/goodpasswd.1 histogram/histogram.1 neno/neno.1 pdfman/pdfman.1 puniq/puniq.1 rand/rand.1 rn/rn.1 rrm/rrm.1 timestamp/timestamp.1 tracefile/tracefile.1 upsidedown/upsidedown.1 wssh/wssh.1 %.1: % pod2man $< > $@ diff --git a/pdfman/pdfman b/pdfman/pdfman index c415ebb..49f85ad 100755 --- a/pdfman/pdfman +++ b/pdfman/pdfman @@ -20,6 +20,8 @@ is then displayed using $PDFVIEWER. If $PDFVIEWER is unset, it tries B, B, and B. +If a viewer of the page is already running, a new viewer will not be +started. =head1 EXAMPLE diff --git a/rn/rn b/rn/rn index c38d10d..441b97c 100755 --- a/rn/rn +++ b/rn/rn @@ -1,19 +1,71 @@ #!/bin/bash -mkdir ~/.rm 2>/dev/null -if mv "$@" ~/.rm ; then - # OK - true -else - mkdir -p ~/.rm/{1..10} - mv "$@" ~/.rm/1 2>/dev/null || - mv "$@" ~/.rm/2 2>/dev/null || - mv "$@" ~/.rm/3 2>/dev/null || - mv "$@" ~/.rm/4 2>/dev/null || - mv "$@" ~/.rm/5 2>/dev/null || - mv "$@" ~/.rm/6 2>/dev/null || - mv "$@" ~/.rm/7 2>/dev/null || - mv "$@" ~/.rm/8 2>/dev/null || - mv "$@" ~/.rm/9 2>/dev/null || - mv "$@" ~/.rm/10 -fi +: <<=cut +=encoding utf8 + +=head1 NAME + +rn - move file into wastebasket + + +=head1 SYNOPSIS + +B I + + +=head1 DESCRIPTION + +B move files to a wastebasket dir called B<.rm>. It is created in +$HOME directory if it cannot be found in any of the (grand*)parent +directories. + + +=head1 AUTHOR + +Copyright (C) 2017 Ole Tange, +http://ole.tange.dk and Free Software Foundation, Inc. + + +=head1 LICENSE + +Copyright (C) 2012 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +at your option any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +=head1 SEE ALSO + +B(1), B(1) + + +=cut + +find_rm_dir() { + dir="$1" + if [ -d "$1"/.rm ] ; then + echo "$1"/.rm + return 0 + else + if [ "/" == $(readlink -f "$dir") ]; then + echo $HOME/.rm + return 0 + fi + find_rm_dir "../$dir" + return $? + fi +} + +rmdir="$(find_rm_dir .)" +mkdir -p "$rmdir" +mv --backup=numbered "$@" $rmdir