03-15-2007
"<< Unmatched" in ksh script using sftp
Getting "syntax error at line 19: `<<' unmatched" trying to run sftp in a ksh script.
...snip...
13 for each in $HOSTS;
14 do
15 if [ ! -d /usr/restore/$each ];
16 then mkdir /usr/restore/$each
17 fi
18 cd /usr/restore/$each
19 sftp -b - server-1 <<EOF
20 get /root/restore/$each.tar
21 bye
22 EOF
23 if [ $? -ne 0 ];
24 then echo "SFTP of $each vitalfiles output to bkupva01 failed." >> 25 failed_hosts.$DATE
26 else continue
27 fi
28 done
...snip...
I've tried sftp -b /dev/stdin server-1 <<EOF also, same result, unmatched <<.
Anyone have any ideas? I'm sure it's simple, but I can't see it to save my life.
Thanks!
mk
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have created a ksh shell script and used it as a login shell for a user.
</etc/passwd>
lramirev:x:111:200:Luis:/export/home/menush:/usr/local/menush/menush
My shell script is like this:
</usr/local/menush/menush>
#!/bin/ksh
#
if ]
then
. $HOME/.profile
fi
... (8 Replies)
Discussion started by: lramirev
8 Replies
2. HP-UX
Hi,
I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone.
And its not dumping core if we run the script using "/bin/sh" instead of "ksh"
Can some body please help me how to resolve this issue.
... (9 Replies)
Discussion started by: simhe02
9 Replies
3. Shell Programming and Scripting
Friends
I have pasted a script below
d08083: cat tests
#!/bin/ksh
if
then
rm -r Last-Previous
mv Previous Last-Previous
mv Current Previous
mkdir Current
#cd Current
mv $1 Current
else
cd Current
mv "$1\$2" Current\*\
fi (4 Replies)
Discussion started by: Renjesh
4 Replies
4. Shell Programming and Scripting
Hi,
Using AIX 5.3 and Ksh.
/>ls -al /usr/bin/ksh
-r-xr-xr-x 5 bin bin 237420 Apr 10 2007 /usr/bin/ksh
/>
I recently started working for a new employer. I have written UNIX K-Shell scripts for many years and have never had this particular issue before. Its perplexing me.
I have... (2 Replies)
Discussion started by: troym72
2 Replies
5. Shell Programming and Scripting
Hi all,
I´ve already searched the forum but can´t find what i am doing wrong.
I am trying to compare two variables using ksh under red hat. The error I get is:
-ksh: .: MDA=`md5sum /tmp/ftp_dir_after_transfer | cut -d' ' -f1 `
MDB=`md5sum /tmp/ftp_dir_before_transfer | cut -d' ' -f1 `... (3 Replies)
Discussion started by: old_mike
3 Replies
6. Shell Programming and Scripting
Hello All
Nice to meet you all here in this forum,
it's my 1rst time here
i'm asking about a little issue that i face
i added a ksh script that echo " please insert your name " and store the output to a login.log file.
the script is working fine with normal telnet
but Xstart is not working... (8 Replies)
Discussion started by: islam.said
8 Replies
7. Shell Programming and Scripting
Hi,
Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator?
cat $AMS/version|read a b verno d
DBVer=$(/usr/bin/printf "%7s" $verno)
I checked that the cat $AMS/version command returns following output:
... (10 Replies)
Discussion started by: dbadmin100
10 Replies
8. Shell Programming and Scripting
Hi,
I have the below KSH shell script:
#!/usr/bin/ksh
if ; then
echo "Usage: resourceSts <server>
else
if ; then source="<server>"
ssh <userid>@$source > output 2>/dev/null <<_EOF
scstat -g
_EOF
elif ; then source="<server>"
ssh... (5 Replies)
Discussion started by: chris01010
5 Replies
9. Shell Programming and Scripting
Hi,
I have an automated script which have set of sqls but when i am trying to execute the automated script by using nohup command, it is throwing an error like "Input is not UTF-8" .
And when i digged in to it, i am getting some "Â" character in the shell script.
How to avoid this!?
Thanks. (1 Reply)
Discussion started by: Samah
1 Replies
10. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies