You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Conor Quinn <qh...@yahoo.com> on 2004/07/25 08:14:58 UTC

command line problem

Hi all!  I'm quite new to FOP and have spent the day
on this Mac OS 10.3.4 researching madly and trying
every possible installation combination I can think of
for fop-0.20.5, but I must be missing something very
very basic that none of the main sites feel the need
to mention: since no matter what I do, the command
line still spits back nothing but

       -bash: fop: command not found

in response to a standard 

       fop fonts.fo fonts.pdf

test of the newly added directory and files.  Running
fop.sh gets the whole set of usage scenarios and the
expected "no input specified" complaint about lacking
, but again, all I get is the above error message in
response to the above command.  Can anyone give me a
hint as to what presumably obvious error I am making? 

Many thanks!


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem

Posted by "Peter B. West" <pb...@tpg.com.au>.
Ganesh,

Thanks for pointing that out.  The advantage of the method is that 
fop.sh does not need to be executable.  That is only required if you try 
to execute it directly, as in ./fop ....

Peter

Ganesh Babu Nallamothu, Integra-India wrote:
> Dear All,
> 
> There is another way of running this fop.
> 
> sh fop.sh will give the same result as ./fop.sh. Make sure that the fop.sh
> is having executable permission to the user.

-- 
Peter B. West <http://cv.pbw.id.au/>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: command line problem

Posted by "Ganesh Babu Nallamothu, Integra-India" <ga...@integra-india.com>.
Dear All,

There is another way of running this fop.

sh fop.sh will give the same result as ./fop.sh. Make sure that the fop.sh
is having executable permission to the user.

Ganesh


-----Original Message-----
From: Clay Leeds [mailto:cleeds@medata.com]
Sent: Monday, July 26, 2004 12:24 AM
To: fop-user@xml.apache.org
Subject: Re: command line problem


On Jul 24, 2004, at 11:14 PM, Conor Quinn wrote:
> Hi all!  I'm quite new to FOP and have spent the day on this Mac OS
> 10.3.4 researching madly and trying every possible installation
> combination I can think of for fop-0.20.5, but I must be missing
> something very very basic that none of the main sites feel the need to
> mention: since no matter what I do, the command line still spits back
> nothing but
>
>        -bash: fop: command not found
>
> in response to a standard
>
>        fop fonts.fo fonts.pdf
>
> test of the newly added directory and files.  Running fop.sh gets the
> whole set of usage scenarios and the expected "no input specified"
> complaint about lacking, but again, all I get is the above error
> message in response to the above command.  Can anyone give me a hint
> as to what presumably obvious error I am making?
>
> Many thanks!

As you guessed, I believe this has a simple solution. The bash
environment is not set up by default to run fop. Since it doesn't
'know' where the fop is, it will give you this error. In addition, you
failed to follow the USAGE:

   fop [options] [-fo|-xml] infile [-xsl file]
   [-awt|-pdf|-mif|-pcl|-ps|-txt|-svg|-at|-print] <outfile>

which translates to (using your example):

   fop.sh -fo fonts.fo -pdf fonts.pdf

In addition, to run FOP, You need to either specify the entire PATH to
fop.sh (on unix, which is essentially basis of Mac OS X), or the entire
PATH to fop.bat (under windows). Instead of what you have, try:

   /path/to/fop-0.20.5/fop.sh -fo /path/to/fonts.fo -pdf
/path/to/fonts.pdf

(NOTE: the above should be all on one line)

Also, you need to put the entire PATH to the INPUT and OUTPUT files. If
you're transforming XML and XSL files to output to a PDF file, each
needs the direct PATH:

   /path/to/fop-0.20.5/fop.sh -xml /path/to/input.xml -xsl
/path/to/input.xsl -pdf /path/to/fonts.pdf

(NOTE: the above should be all on one line)


In my case, since I have FOP installed here:

   /Users/Shared/_WebDLs/fop-0.20.5/

Since I don't have to put the PATH if I'm in this directory, I can
change to it:

   cd /Users/Shared/_WebDLs/fop-0.20.5/

and then run:

   ./fop.sh -fo examples/fo/basic/fonts.fo -pdf fonts.pdf

which will generate the fonts.pdf file in the
/Users/Shared/_WebDLs/fop-0.20.5/ directory.

There are many tricks you can do to make this process easier (i.e., add
'/Users/Shared/_WebDLs/fop-0.20.5/' to your PATH; create a symbolic
link from 'fop' to '/Users/Shared/_WebDLs/fop-0.20.5/fop.sh':

In any case, although this has a 'simple' solution, you've made it
clear that we need to update the 'Running FOP' page[1] to include
examples of running FOP under Unix and Windows.

Thank you for making this POST! I hope this helps!

Web Maestro Clay

[1]
http://xml.apache.org/fop/running.html

Web Maestro Clay <cl...@medata.com>
---
There are only 10 kinds of people in the world: those who understand
binary and those who don't.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem

Posted by Clay Leeds <cl...@medata.com>.
On Jul 24, 2004, at 11:14 PM, Conor Quinn wrote:
> Hi all!  I'm quite new to FOP and have spent the day on this Mac OS 
> 10.3.4 researching madly and trying every possible installation 
> combination I can think of for fop-0.20.5, but I must be missing 
> something very very basic that none of the main sites feel the need to 
> mention: since no matter what I do, the command line still spits back 
> nothing but
>
>        -bash: fop: command not found
>
> in response to a standard
>
>        fop fonts.fo fonts.pdf
>
> test of the newly added directory and files.  Running fop.sh gets the 
> whole set of usage scenarios and the expected "no input specified" 
> complaint about lacking, but again, all I get is the above error 
> message in response to the above command.  Can anyone give me a hint 
> as to what presumably obvious error I am making?
>
> Many thanks!

As you guessed, I believe this has a simple solution. The bash 
environment is not set up by default to run fop. Since it doesn't 
'know' where the fop is, it will give you this error. In addition, you 
failed to follow the USAGE:

   fop [options] [-fo|-xml] infile [-xsl file]
   [-awt|-pdf|-mif|-pcl|-ps|-txt|-svg|-at|-print] <outfile>

which translates to (using your example):

   fop.sh -fo fonts.fo -pdf fonts.pdf

In addition, to run FOP, You need to either specify the entire PATH to 
fop.sh (on unix, which is essentially basis of Mac OS X), or the entire 
PATH to fop.bat (under windows). Instead of what you have, try:

   /path/to/fop-0.20.5/fop.sh -fo /path/to/fonts.fo -pdf 
/path/to/fonts.pdf

(NOTE: the above should be all on one line)

Also, you need to put the entire PATH to the INPUT and OUTPUT files. If 
you're transforming XML and XSL files to output to a PDF file, each 
needs the direct PATH:

   /path/to/fop-0.20.5/fop.sh -xml /path/to/input.xml -xsl 
/path/to/input.xsl -pdf /path/to/fonts.pdf

(NOTE: the above should be all on one line)


In my case, since I have FOP installed here:

   /Users/Shared/_WebDLs/fop-0.20.5/

Since I don't have to put the PATH if I'm in this directory, I can 
change to it:

   cd /Users/Shared/_WebDLs/fop-0.20.5/

and then run:

   ./fop.sh -fo examples/fo/basic/fonts.fo -pdf fonts.pdf

which will generate the fonts.pdf file in the 
/Users/Shared/_WebDLs/fop-0.20.5/ directory.

There are many tricks you can do to make this process easier (i.e., add 
'/Users/Shared/_WebDLs/fop-0.20.5/' to your PATH; create a symbolic 
link from 'fop' to '/Users/Shared/_WebDLs/fop-0.20.5/fop.sh':

In any case, although this has a 'simple' solution, you've made it 
clear that we need to update the 'Running FOP' page[1] to include 
examples of running FOP under Unix and Windows.

Thank you for making this POST! I hope this helps!

Web Maestro Clay

[1]
http://xml.apache.org/fop/running.html

Web Maestro Clay <cl...@medata.com>
---
There are only 10 kinds of people in the world: those who understand 
binary and those who don't.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem

Posted by "Peter B. West" <pb...@tpg.com.au>.
Conor,

I don't know how the Mac environment is set up, but have you tried
fop.sh fonts.fo fonts.pdf
?

Peter

Conor Quinn wrote:
> Hi all!  I'm quite new to FOP and have spent the day
> on this Mac OS 10.3.4 researching madly and trying
> every possible installation combination I can think of
> for fop-0.20.5, but I must be missing something very
> very basic that none of the main sites feel the need
> to mention: since no matter what I do, the command
> line still spits back nothing but
> 
>        -bash: fop: command not found
> 
> in response to a standard 
> 
>        fop fonts.fo fonts.pdf
> 
> test of the newly added directory and files.  Running
> fop.sh gets the whole set of usage scenarios and the
> expected "no input specified" complaint about lacking
> , but again, all I get is the above error message in
> response to the above command.  Can anyone give me a
> hint as to what presumably obvious error I am making? 

-- 
Peter B. West <http://cv.pbw.id.au/>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem: success!

Posted by "Peter B. West" <pb...@tpg.com.au>.
Conor Quinn wrote:
> 
> Yep, this was the issue: my ignorance of the basic
> syntax involved.  For the want of a period (full stop)
> a day was lost.  But not really : I have learned quite
> a bit, since this was my first time trying anything at
> all involving the command line (hence I spent the
> whole of yesterday researching, testing, and
> practicing these newfound knowledge)---and so I thank
> you very much for taking the time to help an
> interested beginner get started: your advice has made
> me confident that I'll be able to do even more with
> these tools, and perhaps offer the same kind of help
> to someone else some day.  Till later, keep well.

I'm pleased you have it working.  BTW, in the interests of security, 
*never* put '.' in a root user's PATH.

Peter
-- 
Peter B. West <http://cv.pbw.id.au/>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem: success!

Posted by Conor Quinn <qh...@yahoo.com>.
--- "Peter B. West" <pb...@tpg.com.au> wrote:

> Bash finds commands using the PATH variable. 
> Non-root users will 
> generally have the current directory (.) appended to
> the PATH.  This can 
> be examined by
> echo $PATH
> 
> If there is no '.' in your path, bash would not have
> found fop.sh.  If 
> your current directory ( 'pwd' will show it ) was
> not the directory 
> containing fop.sh, bash would not have found it
> anyway.  If the file 
> fop.sh is not executable, bash would not have been
> able to run it. What 
> happens when you cd into the directory in which the
> tarball was 
> untarred, and execute
> ls -l fop.sh
> 
> What happens if you execute
> ./fop.sh fonts.fo fonts.pdf
Yep, this was the issue: my ignorance of the basic
syntax involved.  For the want of a period (full stop)
a day was lost.  But not really : I have learned quite
a bit, since this was my first time trying anything at
all involving the command line (hence I spent the
whole of yesterday researching, testing, and
practicing these newfound knowledge)---and so I thank
you very much for taking the time to help an
interested beginner get started: your advice has made
me confident that I'll be able to do even more with
these tools, and perhaps offer the same kind of help
to someone else some day.  Till later, keep well.



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem

Posted by "Peter B. West" <pb...@tpg.com.au>.
Conor,

What's your environment?  Are you running OSX?  I assume so, because I 
assume you are running the commands in a terminal window.

Conor Quinn wrote:
> --- Glen Mazza <gr...@yahoo.com> wrote:
> 
>>Did you build (compile) the application first?  If
>>you
>>just downloaded the source (instead of the binary)
>>version of FOP, you'll need to build the app first
>>by
>>typing "ant" (or "build.sh") at the command line in
>>the root directory.
> 
> I have definitely downloaded the fop-0.20.5-bin.tar.gz
> file, and not the source version.  I would like to try
> out Ant soon, but I'm still wondering what my problem
> with the binary version is.  I suspect that I've just
> missed something very basic in how I structure my
> directory.  As it stands, I just have the above file
> unpacked with StuffIt---oddly and perhaps
> significantly, the suggested tar -xzf approach made it
> cranky:
> 
> gzip: stdin: not in gzip format
> tar: Child returned status 1
> tar: Error exit delayed from previous errors

What happens if you try
tar tvf fop-0.20.5-bin.tar
?  Do you get a list of files without error messages?

> because even with StuffIt turned off, a download still
> just gets me a straight fop-0.20.5-bin.tar on the
> Desktop, not fop-0.20.5-bin.tar.gz.
> 
> Unless I'm missing something, though, I don't think
> the file truncation issue is what's going on, and so I
> just have said tar unarchived with StuffIt and plopped
> on the Desktop directory as a plain folder directory
> ("fop-0.20.5").
> 
> Perhaps, then, this is the problem?  While Apache just
> says to unarchive the tar into a "directory/folder
> that is convenient on your system," is there perhaps
> some further step involved in placing specific files
> in specific places that I have missed?
> 
> Regarding Peter's suggestion, i.e.
...
>>have you tried
>>fop.sh fonts.fo fonts.pdf
>>?
> 
> 
> trying that I got a similar response:
> 
> -bash: fop.sh: command not found 
> 
> Again, it seems that somehow I'm not managing to get
> the fop command into an accessible position.  Any
> suggestions?  Thanks for your help so far!

Bash finds commands using the PATH variable.  Non-root users will 
generally have the current directory (.) appended to the PATH.  This can 
be examined by
echo $PATH

If there is no '.' in your path, bash would not have found fop.sh.  If 
your current directory ( 'pwd' will show it ) was not the directory 
containing fop.sh, bash would not have found it anyway.  If the file 
fop.sh is not executable, bash would not have been able to run it. What 
happens when you cd into the directory in which the tarball was 
untarred, and execute
ls -l fop.sh

What happens if you execute
./fop.sh fonts.fo fonts.pdf

Peter
-- 
Peter B. West <http://cv.pbw.id.au/>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem

Posted by Conor Quinn <qh...@yahoo.com>.
--- Glen Mazza <gr...@yahoo.com> wrote:
> Did you build (compile) the application first?  If
> you
> just downloaded the source (instead of the binary)
> version of FOP, you'll need to build the app first
> by
> typing "ant" (or "build.sh") at the command line in
> the root directory.
I have definitely downloaded the fop-0.20.5-bin.tar.gz
file, and not the source version.  I would like to try
out Ant soon, but I'm still wondering what my problem
with the binary version is.  I suspect that I've just
missed something very basic in how I structure my
directory.  As it stands, I just have the above file
unpacked with StuffIt---oddly and perhaps
significantly, the suggested tar -xzf approach made it
cranky:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

because even with StuffIt turned off, a download still
just gets me a straight fop-0.20.5-bin.tar on the
Desktop, not fop-0.20.5-bin.tar.gz.

Unless I'm missing something, though, I don't think
the file truncation issue is what's going on, and so I
just have said tar unarchived with StuffIt and plopped
on the Desktop directory as a plain folder directory
("fop-0.20.5").

Perhaps, then, this is the problem?  While Apache just
says to unarchive the tar into a "directory/folder
that is convenient on your system," is there perhaps
some further step involved in placing specific files
in specific places that I have missed?

Regarding Peter's suggestion, i.e.

--- "Peter B. West" <pb...@tpg.com.au> wrote:
> Conor,
> 
> I don't know how the Mac environment is set up, but
> have you tried
> fop.sh fonts.fo fonts.pdf
> ?

trying that I got a similar response:

-bash: fop.sh: command not found 

Again, it seems that somehow I'm not managing to get
the fop command into an accessible position.  Any
suggestions?  Thanks for your help so far!



> --- Conor Quinn <qh...@yahoo.com> wrote:
> >  since no matter what I do, the command
> > > line still spits back nothing but
> > > 
> > >        -bash: fop: command not found
> > > 
> > > in response to a standard 
> > > 
> > >        fop fonts.fo fonts.pdf
> > > 
> > > test of the newly added directory and files. 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 
> 


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: command line problem

Posted by Glen Mazza <gr...@yahoo.com>.
Did you build (compile) the application first?  If you
just downloaded the source (instead of the binary)
version of FOP, you'll need to build the app first by
typing "ant" (or "build.sh") at the command line in
the root directory.

Also, building will require downloading & installing
Apache Ant first--time well spent if you haven't done
this already, as Ant is a very useful tool.  Follow
the instructions in build.sh for more information.

Glen

--- Conor Quinn <qh...@yahoo.com> wrote:
>  since no matter what I do, the command
> > line still spits back nothing but
> > 
> >        -bash: fop: command not found
> > 
> > in response to a standard 
> > 
> >        fop fonts.fo fonts.pdf
> > 
> > test of the newly added directory and files. 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org