-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.20180717 | ||
0.20180725 |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.TH "FB2totxt User Manual" 0.20180725 "25 Jul 2018" "User documentation" | ||
|
||
.SH NAME | ||
fb2xmlfix | ||
|
||
.SH DESCRIPTION | ||
Bash-script for console FB2 fix | ||
|
||
.SH SYNOPSIS | ||
fb2xmlfix [options] book.fb2 | ||
|
||
.SH OPTIONS | ||
.TP | ||
-o str | ||
name fix book (default = source.fb2) | ||
.TP | ||
-h | ||
help | ||
|
||
.SH EXAMPLE | ||
fb2xmlfix youbook.fb2 | ||
fb2xmlfix -o youbook-fix.fb2 youbook.fb2 | ||
|
||
.SH COPYRIGHT | ||
Copyright 2018 zvezdochiot. | ||
All rights reserved. | ||
|
||
.SH SEE ALSO | ||
fb2encode, | ||
fb2totxt, | ||
fb2tozip, | ||
xmlstarlet | ||
|
||
.SH CONTACTS | ||
Website: https://github.com/zvezdochiot/bash-fb2 | ||
Email: [email protected] |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/sh | ||
|
||
#fb2encode.sh | ||
#Depends: dash, xmlstarlet | ||
|
||
sname="Fb2XMLFix" | ||
sversion="0.20180725" | ||
|
||
echo "$sname $sversion" >&2 | ||
|
||
tnocomp="" | ||
tcomp="xmlstarlet" | ||
[ ! "$(command -v $tcomp)" ] && tnocomp="$tnocomp $tcomp" | ||
if [ "+$tnocomp" != "+" ] | ||
then | ||
echo "Not found:${tnocomp}!" >&2 | ||
echo "" >&2 | ||
exit 1 | ||
fi | ||
|
||
fhlp="false" | ||
while getopts ":o:h" opt | ||
do | ||
case $opt in | ||
o) dst="$OPTARG" | ||
;; | ||
h) fhlp="true" | ||
;; | ||
*) echo "Unknown option -$OPTARG" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
shift "$(($OPTIND - 1))" | ||
src="$1"; | ||
|
||
if [ "x$src" = "x" -o "x$fhlp" = "xtrue" ] | ||
then | ||
echo "Usage:" | ||
echo "$0 [options] book.fb2" | ||
echo "Options:" | ||
echo " -o name.fb2 name fix book (default = source file)" | ||
echo " -h help" | ||
exit 0 | ||
fi | ||
|
||
if [ "x$dst" = "x" ] | ||
then | ||
dst="$src" | ||
fi | ||
|
||
if [ -f "$src" ] | ||
then | ||
xmlstarlet fo -R -Q "$src" > "$src.verify.xml" | ||
mv -fv "$src.verify.xml" "$dst" | ||
else | ||
echo "$src not fb2 file!" >&2 | ||
fi |