mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

wikilink (325B)


      1 #!/bin/bash
      2 
      3 CURRENT="$1"
      4 NAME="$2"
      5 NORM=$(echo "$NAME" | tr "A-Z" "a-z" | tr ' ' '_' | tr -dc '_a-z0-9-')
      6 FILE_CURRENT="$HOME/todo/wiki/$CURRENT"
      7 FOLDER=$(cat "$FILE_CURRENT" | grep "^Folder:" |cut -d: -f2 | sed 's/ *//')
      8 
      9 echo "[$NORM]"
     10 cat <<EOF > $HOME/todo/wiki/$NORM
     11 # $NAME
     12 
     13 #todo
     14 
     15 Up: [$CURRENT]
     16 
     17 Folder: $FOLDER
     18 EOF