Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ $# -eq 0 ]] ; then
- echo 'pass uid to script, ex 201507030906, or 201407271365'
- exit 0
- fi
- file=$1
- printf "\n# Links to file:\n\n"
- ag $file
- printf "\n# Before and After:\n\n"
- ls|ag -C3 $file
- printf "\n\n# Mutual Links\n\n"
- link=$(ag -o "(?<=§|\[)[0-9]{12}" $file*|sort -n |uniq)
- for line in $link
- do
- title=$(ag -g $line)
- printf "\n## $title \n\n"
- ag $line| ag -v $file
- done
- printf "\n\n# Mutual References\n\n"
- ref=$(ag -o "(?<=\@)[a-z]*[0-9]*[a-z]*" $file*|sort -n |uniq)
- for line in $ref
- do
- title=$line
- printf "\n## $title \n\n"
- ag -o $line| ag -v $file
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement