dot

packages and services management
Log | Files | Refs | README

commit c2e3e8466382b5cd3595980ad9833bac74127bba
parent 11f33be21bf6e3139f4eba3bf54e4316befd4bd2
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 12 Nov 2017 15:45:44 +0100

bin/mv-* and bin/mdoc

Diffstat:
Abin/mdoc | 12++++++++++++
Abin/mv-sane | 11+++++++++++
Abin/mv-split | 9+++++++++
Dbin/sane-name | 14--------------
Adaemon/ssh-agent | 3+++
Mio/http | 3+++
6 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/bin/mdoc b/bin/mdoc @@ -0,0 +1,12 @@ +#!/bin/sh + +case $1 in +dd) + date +'.Dd $Mdocdate: %B %d %Y$' + ;; +bd) + printf '.Bd -literal\n' + sed -e 's/\\/\\\\/g' -e 's/^\./\\./' + printf '.Ed' + ;; +esac diff --git a/bin/mv-sane b/bin/mv-sane @@ -0,0 +1,11 @@ +#!/bin/sh +# only keep '[:alnum:]', ',' and '.' and convert everyting else to '_' + +find . -depth -exec sh -c ' + old=$(basename "$0") + new=$(basename "$0" | tr -d "\\n" | tr -c "[:alnum:],." "_" | + sed -r -e "s/_+/_/g" -e "s/([0-9]+)\\.*_/\\1_/") + dir=$(dirname "$0") + + [ "$dir/$old" != "$dir/$new" ] && mv -- "$dir/$old" "$dir/$new" +' {} ';' diff --git a/bin/mv-split b/bin/mv-split @@ -0,0 +1,9 @@ +#!/bin/sh +# split all names at the separator $1 into subdirectories + +find . -exec sh -c ' + old=$1 + new=$(printf %s "$1" | sed "s|$(printf %s "$0" | sed "s|.|[&]|g")|/|g") + mkdir -p "$(dirname "$new")" + mv -- "$old" "$new" +' "$1" "{}" ';' diff --git a/bin/sane-name b/bin/sane-name @@ -1,14 +0,0 @@ -#!/bin/sh -# only keep '[:alnum:]', ',' and '.' and convert everyting else to '_' - -find . -depth | while IFS='' read -r path -do - dir=$(dirname "$path") - old=$(basename "$path") - new=$( - printf %s "$old" | tr -c '[:alnum:],.' '_' | - sed -r -e 's/_+/_/g' -e 's/([0-9]+)\.*_/\1_/' - ) - - [ "$dir/$old" = "$dir/$new" ] || mv -- "$dir/$old" "$dir/$new" -done diff --git a/daemon/ssh-agent b/daemon/ssh-agent @@ -0,0 +1,3 @@ +#!/bin/sh + +exec ssh-agent -a "$HOME/var/run/ssh-agent" diff --git a/io/http b/io/http @@ -24,3 +24,6 @@ http://systemspace.network http://tttthis.com/rememberwebsites.php https://wiby.me http://wurstcaptures.untergrund.net/music/ +http://win95.ajf.me/win95.html +http://pdp11.aiju.de +http://n-gate.com