01-19-2006
getting an error
I am getting the following error:
run1.ksh[16]: 0403-057 Syntax error at line 16 : `}' is not expected.
I am guessing its due to this block
{
echo "verbose"
echo "open $nodename"
echo "user $username $password"
echo "ls $filename"
echo "quit"
} >$CMDFILE
any ideas?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'm writing a script to perform automated ftp's. What I would like to know is if it is possible to examine return codes or trap any error messages from the remote server.
eg. if during the ftp session i cd to a different directory on the remote server and the directory does not exist, can... (2 Replies)
Discussion started by: Bab00shka
2 Replies
2. Shell Programming and Scripting
Hi all,
I have a directory have all of the .stat and .dat file :
they are is a pipe separate flat file.
Example:
log-20061202.stat contain 1st line and last line of log-20061202.dat with record count of that day.
Example:
Total record = 240
Tom|02-12-2006|1600 W.Santa... (18 Replies)
Discussion started by: sabercats
18 Replies
3. Shell Programming and Scripting
If I have
start = 02282006;
end = 03152006;
How do I get
startdate = 02/28/2006;
enddate = 03/15/2006;
Thanks, (3 Replies)
Discussion started by: britney
3 Replies
4. Shell Programming and Scripting
Hi,
I have this slightly modified FTP code (thanks to this forum)
function gather_FTPDate {
HOST=
USER=
PASSWD=
exec 4>${TEMP_LOG_FILE}
ftp -nv >&4 2>&4 |&
echo $?
if ] then
echo "Unable to connect to FTP server!!!" >> ${LOG_FILE}
return 0
fi
print -p open... (2 Replies)
Discussion started by: psynaps3
2 Replies
5. Shell Programming and Scripting
Ih all,
i have multiples ksh scripts for crontab's unix jobs
they all have same variables declarations and some similar functions
i would have a only single script file to declare my variables, like:
var1= "aaa"
var2= "bbb"
var3= "ccc"
...
function ab { ...}
function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies
6. Shell Programming and Scripting
I am trying to code a ksh script that will check to see if all 26 incoming ftp files have been received before proceeding to the next function, which is to rename each file.
Here is the pseudo-code of what I am trying to do:
<<STEP_1>>
IF all ALS files have been transmitted then... (2 Replies)
Discussion started by: doug145
2 Replies
7. Shell Programming and Scripting
my default profile is using ksh, I tried to write a simple scripts and I had issues, below is my scripts:
$ more if_num.ksh
USAGE="usage: if_num.ksh"
print -n "Enter two numbers: "
read x y
if ((x=y))
then
print "You entered the same number twice."
when I tried to executed the... (6 Replies)
Discussion started by: matthew00
6 Replies
8. Shell Programming and Scripting
Hi
I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email.
For example
-------
Script ABC
-------
a.ksh
b.ksh
c.ksh
I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies
9. Shell Programming and Scripting
Hi,
I'm trying to get "ftp" commands work inside a function written in ksh script; but it seems to be not working!!
Here's the code:
function chk_ftp_path {
IP_ADDR=$1
USER=$2
PASSWORD=$3
FTP_PATH=$4
ftp -ivn $IP_ADDR << EOF
user $USER $PASSWORD
cd $FTP_PATH
quit
EOF
... (9 Replies)
Discussion started by: dips_ag
9 Replies
10. UNIX for Dummies Questions & Answers
Following this thread:
https://www.unix.com/ip-networking/1935-automated-ftp-task.html
I have created the following script:
#! /bin/ksh
HOST=ftp.mywebsite2.com
USER=astrocloud
PASSWD=8****
exec 4>&1
ftp -nv >&4 2>&4 |&
print -p open $HOST
print -p user $USER $PASSWD
print -p cd... (3 Replies)
Discussion started by: Astrocloud
3 Replies