From d0fb29674d2c5617e74a7904067d4d7bca1d46d0 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Sun, 27 Nov 2022 20:06:28 +0100 Subject: [PATCH] [shell] refine ocr output filename --- files/shell/.shellrc.alias | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/shell/.shellrc.alias b/files/shell/.shellrc.alias index 10cff89..09516be 100644 --- a/files/shell/.shellrc.alias +++ b/files/shell/.shellrc.alias @@ -35,11 +35,13 @@ alias conedit='nm-connection-editor' # functions ocr() { - if [ -z $1 ]; then + file=$1 + if [ -z $file ]; then echo "Please input a file." return fi - ocrmypdf -l deu+eng+jpn --output-type pdf $1 OCR_$1 + name=${file%%.*} + ocrmypdf -l deu+eng+jpn --output-type pdf $file ${name}.ocr.pdf } # deprecated