Search this site:
Enterprise Search Blog
« NIE Newsletter

Why are my Vspider Unix scrips are not working on windows? - Ask Dr. Search

Last Updated Mar 2009

By: Mark Bennett, Volume 2 - Issue 2 - July / August 2004

This month's question comes form a customer who switched from a Unix platform to Windows 2000 for a K2 5.5 Verity installation and ran into an unexpected problem: the scripts that had worked fine with Vspider on Unix no longer worked on Windows!

Q: We recently switched from using K2 4.5 on Solaris to a Windows 2000 platformn for our K2 5.5 installation. When we did, we changed the scripts associated with our Vspider index from shell scripts to batch files, but we found Vspider reported command syntax errors. What do we need to change to make Vspider work under Windows?

A: You were right that you needed to convert your shell commands on Unix to batch file commands on Windows 2000, and you got most of the changes right. What you missed is a capability of the Unix shell that Windows has not implemented the same way: continuation lines.

Consider the following Unix script:

#!/usr/bin/csh

echo Starting Vspider
setenv LD_LIBRARY_PATH=/data/verity/k2/_solaris/bin:$LD_LIBRARY_PATH

vspider -purge -collection /data/verity/colls/public \
-command /data/verity/vspider.cmd
echo Index completed

Simple Unix Vspicer script

When you move this script to Windows 2000, you would change the comment lines to start with the Windows "REM" statement; and you can remove the LD-LIBRARY_PATH statement which is not needed under Windows. But what you may not see as a characteristic of Unix is the 'continuation' character at the end of each line in the actual Vspider comnmand: the "\" charater.

Windows uses a different (little known) character to mark a 'continuation' from one line of a batch script to the next: the caret '^' character. Consider the following script:

rem Script to run vspider

echo Starting Vspider

vspider -purge -collection /data/verity/colls/public ^
- style /data/verity/style ^
-command /data/verity/vspider.cmd

echo Index completed

Simple Windows Vspider script

The caret must be the last character on the line; although you can use TAB charaters to format the subsequent line.

By the way, remember that the Vspider command file - vspider.cmd in this example - is processed directly by Vspider, not by the command shell. This means you can have no continuation characters in the command file, just one parameter per line starting with the hyphen. Of course you can have multiple options on the same line:

-norobo -cgiok
-start "http://www.mysite.com/index.html"

Vspider command file

Note also that Unix scripts typically use single quotes around parameter values, while Windows requires double quote characters.

Follow these simple changes and your Vspider scripts should run fine in your new environment!

If you have any questions regarding Verity search products, email your questions to drsearch@ideaeng.com..