10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am not able to capture error condition in sftp in Korn Shell
#!/bin/ksh
sftp batch@uat >abc 2>&1 << ENDFILE
cd public
put /data/WELCOME_55
ENDFILE
ret_val=$?
if ]
then
print file "copied successfully"
else
print file "NOT copied successfully"
fi
return 0
Now the... (9 Replies)
Discussion started by: Soham
9 Replies
2. Shell Programming and Scripting
Hi this is my first post, so forgive me if what I'm requesting doesn't make sense.
I'm connecting into a Unix server via SSH and using a Korn Shell (#!/bin/ksh). The Unix server has Oracle 11g installed on it and there are a number of scripts already setup to query the Oracle database to perform... (2 Replies)
Discussion started by: KeithJ
2 Replies
3. Shell Programming and Scripting
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies
4. Shell Programming and Scripting
Hi, need help, I would like to know what is this IF statement trying to do? When the script is executing and error out with line 9 which is the IF statement line.
if ]
then
TOPDIR=$(pwd)
else
TOPDIR=${0%/*}
fi
TOPDIR=${TOPDIR%/*}
the log file.
Current system time is... (15 Replies)
Discussion started by: beooi
15 Replies
5. Shell Programming and Scripting
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies
6. Shell Programming and Scripting
Hi All, I am new to this forum as well as to unix scripting.
Can you please help me to create a korn shell script to find out errors in logfiles and get the name of that logfile ( which is having error) in email and email it to me? (2 Replies)
Discussion started by: jithu
2 Replies
7. Shell Programming and Scripting
well i have this code here..and it works fine in kornshell..
#!/bin/ksh
home=c:/..../
input=$1
sed '1,3d' $input > $1.out
line=""
cat $1.out | while read a
do
line="$line $a"
done
echo $line > $1
rm $1.out
however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies
8. UNIX for Advanced & Expert Users
Hi,
I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise.
Thanks,
Gopi (4 Replies)
Discussion started by: bhgopi
4 Replies
9. Shell Programming and Scripting
I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server..
I have seen some code that may help - but I cant get it working as below:
spawn /usr/bin/ksh
send "telnet x <port_no>\r"
expect "Enter command: "
send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies
10. Shell Programming and Scripting
Hi,
I am trying to write a script which will loop until a certain action has been performed. I have two files i would like to compares.
For example:
file1 has a list of user ids (about 900) from the company's e-mail server.
file2 has a list of user ids (about 50 or so) from... (7 Replies)
Discussion started by: muzica
7 Replies