Syntax problem with Unix ftp get command


 
Thread Tools Search this Thread
Operating Systems HP-UX Syntax problem with Unix ftp get command
# 1  
Old 02-08-2007
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.
# 2  
Old 02-08-2007
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.
# 3  
Old 02-09-2007
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with FTP from Unix to Windows

I am unable to use get or put command in a ftp session where remote system in Windows_NT. ftp> put rowb1_cbp14_20111116.txt local: rowb1_cbp14_20111116.txt remote: rowb1_cbp14_20111116.txt 227 Entering Passive Mode (10,130,6,29,14,245) (3 Replies)
Discussion started by: Naga06
3 Replies

2. Shell Programming and Scripting

Problem with FTP from Unix to Windows

I am unable to use get or put command in a ftp session where remote system in Windows_NT. ftp> put rowb1_cbp14_20111116.txt local: rowb1_cbp14_20111116.txt remote: rowb1_cbp14_20111116.txt 227 Entering Passive Mode (10,130,6,29,14,245) Pls suggest a way. (0 Replies)
Discussion started by: Naga06
0 Replies

3. Shell Programming and Scripting

Problem in using ftp command under if statement

If i use ftp command under if statement it shows the error "Syntax error at line 19 : `<<' is not matched." But if i use ftp command outside if statement, then it is running fine. Can anyone please help me in this. Code: #!/bin/sh echo "\nPress 1 for automated file dumping." echo... (9 Replies)
Discussion started by: makauser
9 Replies

4. UNIX for Dummies Questions & Answers

Syntax for own UNIX command

hi All, how can i make my own commamnds for unix shell scripts. lets xmple.. 1-i want to use "down arrow key" for previous runned unix commands. then how to acheive it. 2-Generally TAB --- complete filename or command up to the point of uniqueness ..but here its not working .. I m new to... (1 Reply)
Discussion started by: pradeepcarya
1 Replies

5. UNIX for Dummies Questions & Answers

FTP put command problem

Hello,I am trying to put something on the ftp server using the put command. Whenever I try, I get this error: ftp> put SIMS.war local: SIMS.war remote: SIMS.war 200 PORT command successful 553 Can't open that file: Permission denied I have set rwx for all on that file and I still am... (3 Replies)
Discussion started by: mojoman
3 Replies

6. UNIX for Dummies Questions & Answers

Problem in FTP from Unix to Mainframes

Hi, I have one file to FTP from Unix to mainframe. It has been successfully FTPied. But problem is my Unix file will be generated as file_name1.sh. But Mainframes side they need file in file.name1.sh. So they dont need underscore (_) in the file name. Please let me know if there is any solution... (1 Reply)
Discussion started by: manneni prakash
1 Replies

7. UNIX for Dummies Questions & Answers

UNIX FTP file problem

Hi, I am new to this forum. I have a problem and I ws hoping you guys can help me out here. the problem: I have a batch job running on a Unix Server, and it transfers files from the unix server to another server. the series of commands are as follows: > LS Listing the files > Logging into... (4 Replies)
Discussion started by: Vanilmirth
4 Replies

8. UNIX for Dummies Questions & Answers

Problem with FTP o n Unix SCO

my problem is like this while ftping locally it works, but when users from WAN try the ftp services it doesnt comes the message it displays is as follows "connection closed by remote host " please help Thanks (5 Replies)
Discussion started by: Athos19
5 Replies

9. UNIX for Dummies Questions & Answers

FTP problem on unix-server

hi there, i am a sap-programmer and i sent pdf-files via FTP from sap (on an iseries-machine) to a UNIX-server every day. i am doing it via MPUT *.pdf It works well until today. I got the ftp-message "Arguments too long"....i searched for it in the internet and here in the forum. it says... (9 Replies)
Discussion started by: smartin999
9 Replies

10. Shell Programming and Scripting

FTP on Reliant UNIX - script problem

Hello... I have script that works perfect on solaris but on Reliant UNIX sometimes it does not work ...I send files to my Xp(from Reliant UNIX) but if I try to send it to my solaris machine file can not be send... script is: #!/bin/ksh localFile=$1 remoteFile=$2 ... (0 Replies)
Discussion started by: amon
0 Replies
Login or Register to Ask a Question