The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help for Sed Syntax problem SanjayLinux Shell Programming and Scripting 2 10-15-2007 10:52 PM
syntax problem rajan_ka1 Shell Programming and Scripting 3 03-16-2006 07:13 AM
syntax problem rajan_ka1 Shell Programming and Scripting 3 03-08-2006 10:04 AM
Command syntax dsimpg1 UNIX for Dummies Questions & Answers 2 02-17-2005 11:13 AM
Problem with UNIX cut command kevin80 Shell Programming and Scripting 3 05-28-2003 06:57 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-08-2007
Registered User
 

Join Date: Jan 2007
Posts: 6
Syntax problem with Unix ftp get command

An outside vendor has staged 2 batch files for us and I've tried to retrieve the files using the commands that they've indicated I could use to retrieve one file at a time. I've tried using this command in a shell script after a successful connection to their server:
get "$$ ID=IL096869 BID='PGP LBX IMAGER ILFSLBX' ONEBATCH=Y" $FTPFILE

The error I receive:
550 $$ command missing or syntax error -> <15928 ID=IL096869 BID='PGP LBX IMAGER
ILFSLBX' ONEBATCH=Y>
I suspect it's the difference between Windows ftp and Unix and the interpretation of either the double quotes or the $$.
Does anyone spot the problem?
Thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 02-08-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Looks like pure gibberish.

$$ will give you the current pid in a shell script.

You talk about batch/shell scripts and windows/unix, which is which? What have you been given?

When automating windows FTP sessions I generate a script.fto which has username and password as separate lines at the start, the various get/put and quit, then invoke it with the -s option.

eg, script.ftp contents

myuser
mypassword
binary
get foo
quit

cmd -

ftp -s:script.ftp hostname

On UNIX I use the "$HOME/.netrc" file to manage the username/password then pass the get/put etc in as stdin to ftp.
Reply With Quote
  #3  
Old 02-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 6
Hello Porter,
Not gibberish at all. We use ftp commands in Unix shell scripts for several outside vendors and have just the logon information in the .netrc file. Typically we deal with actual file names but this bank has established a macro of some sort that allows us to either get all the files in one batch or one file at a time using the ONEBATCH parameter. We never see actual filenames on their servers. Here is the command that I used that finally allowed me to successfully retrieve one file at a time:
get "\$$ ID=IL096869 BID='PGP LBX IMAGER ILFSLBX' ONEBATCH=Y" $FTPFILE
The \ was the missing link that literally told the command interpreter to ignore special treatment of the $.
The retrieval is accomplished using user ID and Batch ID arguments instead of actual filenames.
Works pretty slick.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:32 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0