Simple command to bookmark files

tags
view raw .gitignore hosted with ❤ by GitHub
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-09-18 17:19:45 (UTC+0200)
DIRSCRIPT="$(dirname "$(readlink -f "$0")")"
BMFDIR=$HOME/misc
FILENAME=$1:a
LIGHTGREEN='\033[1;32m'
LIGHTRED='\033[1;31m'
NC='\033[0m' # No Color
####
cd $BMFDIR &&
/home/bougui/bin/tidyup
ERROR=$(ln -s $FILENAME . 2>&1) &&
touch -h $FILENAME:t &&
printf "${LIGHTGREEN}$FILENAME linked in $BMFDIR ${NC}\n" ||
printf "${LIGHTRED}bmf error | $ERROR ${NC}\n"
view raw bmf.sh hosted with ❤ by GitHub
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2018-09-19 09:33:55 (UTC+0200)
# See: https://stackoverflow.com/a/5947802/1679629
#Black 0;30 Dark Gray 1;30
#Red 0;31 Light Red 1;31
#Green 0;32 Light Green 1;32
#Brown/Orange 0;33 Yellow 1;33
#Blue 0;34 Light Blue 1;34
#Purple 0;35 Light Purple 1;35
#Cyan 0;36 Light Cyan 1;36
#Light Gray 0;37 White 1;37
LIGHTRED='\033[1;31m'
NC='\033[0m' # No Color
setopt +o nomatch
BMFDIR=/home/bougui/misc
nfiles=$(rm -rvf $BMFDIR/*(mh+24) | wc -l)
if [ $nfiles -gt 0 ]; then
if [ $nfiles -gt 1 ]; then
printf "${LIGHTRED}Cleaning up: $nfiles files removed${NC}\n"
else
printf "${LIGHTRED}Cleaning up: $nfiles file removed${NC}\n"
fi
fi
view raw clean_bm.sh hosted with ❤ by GitHub
If you want to ask me a question or leave me a message add @bougui505 in your comment.