Created
April 21, 2022 10:36
-
-
Save jianyun8023/a4b8e9568f896a09e495fb5ff12f1d20 to your computer and use it in GitHub Desktop.
ebook convert base on eCore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
workdir=$(pwd) | |
filepath=$1 | |
format=$2 | |
outdir=$3 | |
book_convert(){ | |
filepath=$1 | |
format=$2 | |
tmp_dir="$HOME/Downloads/eCoreCmdtmp/$(uuidgen)" | |
mkdir -p $tmp_dir | |
# rm -rf "$HOME/Downloads/eCoreCmdtmp" | |
dirname=$(dirname "$filepath") | |
input_file_type=$(echo ".${filepath##*.}") | |
basename=$(basename -s $input_file_type "$filepath") | |
origin_name=$(basename "$filepath") | |
newfile_neme=$basename"."$format | |
echo "- Convert $basename to $format" | |
echo "$workdir/eCoreCmd c $dirname/$origin_name $outdir/$newfile_neme $tmp_dir" | |
$workdir/eCoreCmd c "$dirname/$origin_name" "$outdir/$newfile_neme" "$tmp_dir" | |
rm -rf $tmp_dir | |
echo "- Done! $origin_name , output file: $newfile_neme" | |
} | |
book_convert "$1" $2 |
Epubor Ultimate is NOT FREE software!
@caihk We use it for research purposes only. Alternatively, you can send an email to request their development license.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The reason for writing this script is that eCore's commands are so difficult to use.