
jlk4p
New User
Jul 31, 2007, 6:48 AM
Post #1 of 6
(1483 views)
|
|
piped Perl command line problem
|
Can't Post
|
|
Folks, I'm maintaining a script process (which has been working for a couple years) that includes a shell command that ssh's to another server and executes a Perl script to get some XML data returned, which is then piped to a Perl single line command:
ssh server.name.domain path/to/command.pl | perl -ne 'if ( /<pid>((dummy|uva-lib):[0-9]*)<\\/pid>/ ) { print \"$1\\n\" }' I have confirmed that the ssh process/Perl script is still working with the authentication configuration being used. And it returns data in this format
<?xml version="1.0" encoding="UTF-8"?> <pidList xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fedora.info/definitions/1/0/management/ https://repo.lib.virginia.edu:18443/getNextPIDInfo.xsd"> <pid>dummy:50431</pid> <pid>dummy:50432</pid> </pidList> It seems that the single line command that checks for a pattern match is no longer working. I'm wondering if the Mac OS X 10.4 system this runs on may have had a s/w update performed on it that updated the Perl version (5.8.6) and made this code no longer functional. From my work with regular expressions, everything looks fine in this code. But it generates this error: Bareword found where operator expected at -e line 1, near "/<pid>((dummy|uva-lib):[0-9]*)<\\/pid" (Missing operator before pid?) syntax error at -e line 1, near "/<pid>((dummy|uva-lib):[0-9]*)<\\/pid" Search pattern not terminated at -e line 1. Any suggestions would be appreciated. Thanks, Jack
|