Posts Tagged ‘bash’
* Multiple Input with Single Input Apps
Posted on December 24th, 2008 by John. Filed under programming.
The few eBook formating tools I’ve posted all share one major flaw. They can only handle a single file as input. This is a problem when you want to run it on all or a number of different eBooks. If you are able to use Bash there is a simple way to run any single input command with multiple items.
This first method gets input from a single directory. This method will not go into subdirectories for input.
$ cd ~/Books/author $ ls -1 *.txt | while read file; do echo $file; ./fix_paragraphs_ebook_txt "$file"; ./remove_extra_whitespace_ebook_txt "$file"; done
This second method gets all files matching the given pattern and will handle subdirectories.
$ find ~/books/ -iname "*.txt" | while read file; do echo "$file"; dos2unix -ad "$file"; ./fix_end_ebook_txt "$file"; done
Tags
bash
batteries
bookeen
c++
calibre
cats
cover
cybook
device interfaces
ebook
electronics
epub
eReader
ezreader pocket pro
fb2
gadgets
GeR2
google
GUI
image
json
KDocker
kindle
Linux
markdown
mobi
N770
nook
palmdoc
pdb
pdf
pgm
pml
pmlz
pocket pro
pyqt
python
qt
rb
release
thumbnail
txt
x11
xlib
ztxt
Archives
- July 2010 (4)
- June 2010 (1)
- May 2010 (2)
- March 2010 (1)
- January 2010 (8)
- December 2009 (5)
- November 2009 (6)
- October 2009 (4)
- September 2009 (2)
- August 2009 (6)
- July 2009 (6)
- June 2009 (4)
- May 2009 (6)
- April 2009 (4)
- March 2009 (2)
- February 2009 (4)
- January 2009 (4)
- December 2008 (7)
- November 2008 (2)