- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp scripting question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2005 08:00 AM
тАО12-30-2005 08:00 AM
ftp -n -v << endl >> ach_ftp.log
#
# Open an ftp connection
# Pass in username and password
# Set the transfer mode binary).
# Put the file into the ftp location
# Quit the ftp connection.
# Close the log file.
#
open $NODE
user $USERID $PASSWD
binary
put $PGP_DAILY/ach.encrypted $FILE
quit
endl
However if I indent the lines for readability in the script - the script will not work. I was just wondering why the commands can't be indented in the script?
Dennis
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2005 08:16 AM
тАО12-30-2005 08:16 AM
Re: ftp scripting question
Is that what you are looking for or detail how you are indenting .
# Open an ftp connection
# Pass in username and password
# Set the transfer mode binary).
# Put the file into the ftp location
# Quit the ftp connection.
# Close the log file.
#
ftp -n -v << endl >> ach_ftp.log
open $NODE
user $USERID $PASSWD
binary
put $PGP_DAILY/ach.encrypted $FILE
quit
endl
thx,
bl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2005 08:25 AM
тАО12-30-2005 08:25 AM
Re: ftp scripting question
The technique you are using is called a "here-document". Input is read up until the word that follows the '<<'. In this case you choose the word "endl" which cannot be indented.
If a '-' is appended to the '<<', then all leading *tab* characters are stripped from word and from the document. This *does* allow for indentation.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2005 08:36 AM
тАО12-30-2005 08:36 AM
SolutionYou can use file .netrc in homedir of the user, which run ftp. For ftp session on NODE the file must contain the following part:
machine NODE
login USER
password PASSWORD
macdef init
bin
cd incoming
lcd /tmp
put swlist.out
quit
You can modify the file from a script and after that run ftp NODE
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2005 10:59 AM
тАО12-30-2005 10:59 AM
Re: ftp scripting question
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-01-2006 05:59 PM
тАО01-01-2006 05:59 PM
Re: ftp scripting question
ftp -ivn $NODE <<-EOF << ach_ftp.log
use $USERID $PASSWD
binary
put $PGP_DAILY/ach.encrypted $FILE
bye
EOF
will suite to use intent requirement.
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-01-2006 08:17 PM
тАО01-01-2006 08:17 PM
Re: ftp scripting question
you you want to indent you can use <<- and tabs.
From man ksh:
<<[-]word The shell input is read up to a line that matches
word, or to an end-of-file. No parameter
substitution, command substitution, or file name
generation is performed on word. The resulting
document, called a here-document, becomes the
standard input. If any character of word is
quoted, no interpretation is placed upon the
characters of the document. Otherwise, parameter
and command substitution occurs, \new-line is
ignored, and \ must be used to quote the
characters \, $, `, and the first character of
word. If - is appended to <<, all leading tabs
are stripped from word and from the document.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-01-2006 08:22 PM
тАО01-01-2006 08:22 PM
Re: ftp scripting question
If - is appended to <<, all leading tabs
are stripped from word and from the document.
what you are requiring.
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 05:32 AM
тАО01-03-2006 05:32 AM
Re: ftp scripting question
Dennis