X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=bashrc;h=0b09ca9d6274aedb5293d3af08921551572ad699;hb=1bfd97b594f957327ab39c005576174537aee513;hp=ef555d6f4205da62e2d22b04f0df03f20dee1ff3;hpb=5d2e211f0e3dbd1b497b41f4f0c2524eeb9aed32;p=scripts.git diff --git a/bashrc b/bashrc index ef555d6..0b09ca9 100644 --- a/bashrc +++ b/bashrc @@ -104,7 +104,7 @@ alias rm='rm -i' alias mv='mv -i' # alias chmod='chmod -v' alias chmod='chmod -c' -alias cp='cp -i' +alias cp='cp -i -v' alias rd=rmdir alias md='mkdir -v' alias ps='ps uxaf' @@ -180,16 +180,22 @@ function latexdiff () { # corresponding tex file function rl () { - RECENT_LOG=$(find -maxdepth 1 -name "*.log" -type f | head -1) + RECENT_LOG=$(ls -t $(find -maxdepth 1 -name "*.log" -type f) | head -1) + if [[ ${RECENT_LOG} ]]; then - FILE=${RECENT_LOG/.log/} - pdflatex ${FILE} - bibtex ${FILE} - pdflatex ${FILE} - pdflatex ${FILE} - if [[ "$1" == "--xpdf" ]]; then - xpdf ${FILE}.pdf + FILEBASE="${RECENT_LOG/.log/}" + + pdflatex "${FILEBASE}" + bibtex "${FILEBASE}" + pdflatex "${FILEBASE}" + pdflatex "${FILEBASE}" + + if [[ "$1" == "--view" ]]; then + xpdf "${FILEBASE}.pdf" + elif [[ "$1" == "--print" ]]; then + lpr "${FILEBASE}.pdf" fi + else echo "Can not find a recent log." >&2 return 1