chm and pdf help in terminal (rename)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers chm and pdf help in terminal (rename)
# 1  
Old 05-16-2008
chm and pdf help in terminal (rename)

i have a cd of pdf and chm documents that i transfered from my windows xp box. i transfered the files to my linux box (ubuntu hardy). unfortunately, i used to be a windows GUI only user so the use of spaces and "( )" and underscores. now that i use linux, ive been using CLI for using and moving/coping files. when i tried to view a .chm file, i had installed chmsee for those files, i got problems saying that the use of "(" isnt allowed. is there anyway in the terminal to use those files in such a fashion like, for example, the file "Linux file (2005).chm", and use "mv" the change the name without having to use GUI. something like this:
"mv Linux file (2005).chm Linux_file_2005.chm"
is this possible???
# 2  
Old 05-17-2008
You just need to escape or double quote the special characters on the command line. In my experience, Bash does this for you automatically with tab completion, although there are some minor glitches.

The only characters you absolutely cannot use in a file name are slash (because it's used to separate directories) and ASCII null (because it's used internally to terminate strings).

Here's a quick attempt at batch rename.

Code:
for f in *; do
  case $f in *[!A-Za-z0-9_-]*)  mv -i "$f" "`echo "$f" | tr " " _ | tr -dc A-Za-z0-9_-`";; esac
done

This might be even a little bit too conservative in what characters it will accept in a file name, but at least it's a start.
# 3  
Old 05-17-2008
ok
i used the double quotes around the original file name and then changed it with underscores. thanks for the tip.

Code:
for ex: linux books 2005.chm
$mv "linux books 2005.chm" linux_books_2005.chm

the only problems i have is that im trying to open the files up with ChmSee via terminal

Code:
chmsee linux_books_2005.chm

the problem is i get this
Code:
chmsee: error while loading shared libraries: libxul.so: cannot open shared object file: No such file or directory

should i get another viewer or is there a way to get the libxul.so file
# 4  
Old 05-17-2008
If you installed chmsee from an Ubuntu repository, it should have pulled in any packages it depends on.

Code:
vnix$ apt-file search libxul.so
libxul-dev: usr/lib/libxul.so
libxul0d: usr/lib/libxul.so.0d
libxul0d: usr/lib/xulrunner/libxul.so
libxul0d-dbg: usr/lib/debug/usr/lib/libxul.so.0d
xulrunner-1.9: usr/lib/xulrunner-1.9a8/libxul.so
xulrunner-1.9-dev: usr/lib/xulrunner-devel-1.9a8/sdk/lib/libxul.so

If you just want the library, I guess you should linstall libxul0d, although it's of course somewhat likely that the exact version is not what chmsee wants.

(XUL is the Mozilla toolkit, XULrunner is basically Mozilla without the actual browser -- can be useful for running Chatzilla as a separate process, for example.)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Split and Rename files using Terminal and bin/bash

I have a file named Me_thread_spell.txt that I want to split into smaller files. I want it to be split in each place there is a ;;;. For example, blah blah blah ;;; blah bhlah hlabl awasnceuir asenduhfoijhacseiodnbfxasd;;; oabwcuhaweoir;;; This full file would be three separate files... (7 Replies)
Discussion started by: mschpers
7 Replies

2. Shell Programming and Scripting

Find and Rename File using Terminal

I need help finding a file through terminal and then renaming it automatically. Here is what I have so far to find the file: cd /User/Applications find . */SourceM.app/banner.png | while read line; do mv "$line" banner-.png; done I want the script to rename the file "banner.png" to... (6 Replies)
Discussion started by: rbisconti97
6 Replies

3. Shell Programming and Scripting

How to open a pdf file from terminal?

how to open a .pdf file from terminal not using gpdf I work on fedora 12 and default application assigned for viewing the pdf files is document-viewer (3 Replies)
Discussion started by: rrd1986
3 Replies

4. UNIX and Linux Applications

Application to create/edit chm files

Does someone knows an application to create/edit *.chm files? Any suggestion will be much appreciated! (2 Replies)
Discussion started by: agasamapetilon
2 Replies

5. UNIX for Advanced & Expert Users

how to view .chm format files?

how can i open the .chm format files in fedora7 and rhel3,4 files? (2 Replies)
Discussion started by: praveen_b744
2 Replies

6. UNIX for Dummies Questions & Answers

How to rename Xterm terminal in VNC session

Hi All, We are using VNC viewer to login to remote server. Remote server is running with Red Hat linux 3.0. Our problem is, we are unable to rename xterm terminal so is there any way we can rename? Thanks a lot in advance for your valuable inputs. Regards, Bachegowda (0 Replies)
Discussion started by: bache_gowda
0 Replies

7. UNIX for Dummies Questions & Answers

Reading *.chm files?

I have a bunch of e-books I got but i can't open them. Can I somewhat convert them into html? I don't have an X-server yet so any GUI-programs are out of the question. Are there any programs I might have? Running Debian. Regards Richard (3 Replies)
Discussion started by: riwa
3 Replies

8. UNIX for Dummies Questions & Answers

How to read *.chm file under linux?

How can I read *chm (compiled HTML) file under linux? (2 Replies)
Discussion started by: HOUSCOUS
2 Replies
Login or Register to Ask a Question