Chapter 4. Redirection, scripts and backups.

Scripts. XSL conversions can require a lot of commands and options, most of which do not change between runs. pilot-qof includes sample scripts that demonstrate how to ease the process.

Example 4.1. Using stylesheets in scripts of your own

A typical command from one of these scripts is:

XML_CATALOG_FILES="/usr/share/xml/datafreedom/xsl/catalog.xml" \
 xsltproc --nonet $1

$1 indicates the first argument passed to the script (in this case an XML file). XML_CATALOG_FILES is an environment variable, set just for this script. Where stylesheets in this manual can use other options, these are documented in a shortened form that omits the environment variable and the URL of the stylesheet.

Sample bash scripts are neither installed into system-wide locations nor available within the default system path. You are advised to copy the scripts into user-specific locations to make it easier to adjust the script behaviour.

Although it is fine to pipe pilot-qof output to other processes like xsltproc, (note the terminal dash - to denote that xsltproc should expect the XML content on stdin) :

Example 4.3. Redirection from a QSF XML file.

$ pilot-qof -x whole_year.xml --invoice-city -t 2006-03-01 | \
xsltproc --nonet -

Just remember that it might not be so wise to do this:

Example 4.4. Redirection from a HotSync - use with caution.

$ pilot-qof -a --invoice-city -t 2006-03-01 | \
xsltproc --nonet -

Why? Because using -a means that your Palm data is not being backed up in this process (because the XML sent to xsltproc by the pipe is not saved and cannot be recreated from the HTML). Now, of course, you can sync your Palm twice but reading from the backup file is a lot faster.


"If the Palm data has changed, use -a to backup to file.

If the Palm data has not changed, use -x to read the backup file."

Reporting Bugs. Please do NOT report bugs in pilot-QOF to pilot-link or GnuCash. Report bugs via the Pilot-QOF Mantis bug tracker.