You are not logged in.
This has been annoying me for... ages... years even. It took me this long to bother looking for a solution, and now I can't find one! Not on Google, wiki, or forum search. It's got to be the newbiest question ever, yet I'm stumped.
When I want to open a file in oo from the commandline, I use this:
oo -writer myfile.odt
It works beautifully.
But if the filename has spaces, no matter what I try:
$ oo -writer my\ file.odt
$ oo -writer "my file.odt"
$ oo -writer "my\ file.odt"
$ oo -writer 'my file.odt'
I get the same error. A little box saying that the file "my" does not exist, and a second one saying that "file.odt" does not exist.
How can I convince OO that, in fact, this is a single filename? It opens fine from the GUI open dialog, but I do stuff from the command line often enough that it's become a real pet peeve.
Dusty
Offline
Never seen 'oo' before - if this is an alias or wrapper of your own - then, by the time you come to 'swriter' you will have two files - 'my' and 'file.odt'
I _think_ that you have to
a) call swriter directly or
b) quote your arguments before invoking swriter
[edit]
yup - I had no problems doing a
/usr/lib/openoffice/program/swriter 'my file.odt'
[/edit]
Last edited by perbh (2010-01-20 16:56:30)
Offline
That's confusing.. I've got the openoffice-base 3.1.1-2 packet from [extra] installed on my machine, but there is no binary named 'oo' in my search path (or in the packet). Instead, what I use to start OpenOffice is
soffice copy\ of\ file.doc
which works as expected.
Which vesion of OpenOffice did you install?
Offline
I'll be damned... no wonder google didn't help. Now I feel either foolish, or like I'm losing my mind.
Apparently, oo is a poorly escaped bash script in my /usr/bin directory with these contents:
#!/bin/sh
export OOO_FORCE_DESKTOP=gnome
soffice $@
I don't remember writing it, although I can see why I did it, at the time. I've been using 'oo' for so long, I didn't realize it wasn't an official command.
soffice -writer my\ file.doc works just fine.
(edit: NOT A) Solution:
dusty:bin $ sudo rm oo
dusty:bin $ sudo ln -s soffice oo
Last edited by Dusty (2010-01-20 18:04:43)
Offline
Then add the "export OOO_FORCE_DESKTOP=gnome" to your /etc/profile (or even better /etc/profile.d/dusty).
Offline
I don't know what version of openoffice you have, but both the Quote and Escape methods worked using oowriter from the go-office package. Maybe you just have to upgrade openoffice.
Did you try tab completion to see if that works, assuming the file starts with unique characters.
Live Free or Die !
Offline
I'll be damned... no wonder google didn't help. No I feel either foolish, or like I'm losing my mind.
Apparently, oo is a poorly escaped bash script in my /usr/bin directory with these contents:
#!/bin/sh export OOO_FORCE_DESKTOP=gnome soffice $@
I don't remember writing it, although I can see why I did it, at the time. I've been using 'oo' for so long, I didn't realize it wasn't an official command.
soffice -writer my\ file.doc works just fine.
Solution:
dusty:bin $ sudo rm oo dusty:bin $ sudo ln -s soffice oo
You need
soffice "$@"
in your wrapper script. Otherwise it won't work .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
You need
soffice "$@"
in your wrapper script. Otherwise it won't work .
No kidding? :-P Everybody make fun of Dusty, he wrote a bad wrapper once and then forgot it wasn't the real program!
That doesn't make me a bad person. I mean, some people, phrakture, for instance, get hacked regularly, and can't touch type!
Dusty
Last edited by Dusty (2010-01-20 17:46:57)
Offline
sudo ln -s soffice oo isn't a very good solution either.
Offline
This should make it abundantly clear (mind you, I think it is allready ...)
#!/bin/sh
ekko() { i=1; while test $i -le $#; do echo "$i: ${!i}"; let i+=1; done; return 0; }
a="my file.odt"
ekko $a # => 1: my
# 2: file.odt
ekko "$a" # => 1: my file.odt
Last edited by perbh (2010-01-20 18:07:57)
Offline
sudo ln -s soffice oo isn't a very good solution either.
Too true; soffice uses basename, and the symlink actually fails.
I'll just have to use soffice properly from now on. I just assumed that openoffice had graduated from their staroffice days to a more aptly named binary.
Dusty
Offline
B wrote:You need
soffice "$@"
in your wrapper script. Otherwise it won't work .
No kidding? :-P Everybody make fun of Dusty, he wrote a bad wrapper once and then forgot it wasn't the real program!
That doesn't make me a bad person. I mean, some people, phrakture, for instance, get hacked regularly, and can't touch type!
Dusty
Well I was being gentle, but if you want us to make fun of you...
No worries though - I only know it because I used to repack OOo2 for the distro I used before, and users alerted me to this very problem.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline