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. UNIX for Dummies Questions & Answers
Hi all,
Can someone point me in the right direction for a manual on the various statement options for 'if'. Basically I have a piece of code which says:
if ]
and I wondered what the -f was. I know the '!' means not equal..
As usual any help much appreciated.. (5 Replies)
Discussion started by: Grueben
5 Replies
3. Shell Programming and Scripting
Hi
I wanted to print/store just a specific element of the list . I have got the list as an output of grep command.
here is code snap below :
end_no=`egrep -ni '!return code: 0|return code other than 0' temp.log | cut -d':' -f1`
this will return the line numbers in end_no. I just... (2 Replies)
Discussion started by: Shell@korn
2 Replies
4. Shell Programming and Scripting
how do you show each filename in a giving directory and delete the specific file in korn script
i was thinking using ls rm ? but i cant make it work (0 Replies)
Discussion started by: babuda0059
0 Replies
5. Shell Programming and Scripting
Hi All,
I am able to SFTP files using the below command in my script.
sftp -b test.bat $user@$IP << EOF
i have written the following command in the test.bat file
put /home/user1/testfile.txt /ftpdata/out/
quit
i am able to sftp the testfile.txt from one server to another. could any... (1 Reply)
Discussion started by: singhald
1 Replies
6. UNIX for Dummies Questions & Answers
hello,
i want to know how to initialize a file to an empty one in korn shell scripting? i'm using a file name and building it during a while loop using >>. The problem occurs when the file is not empty before reaching the while loop. therefore, i want to initialize it before the loop to get... (6 Replies)
Discussion started by: alrinno
6 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have two text files containing records in following format:
file1 format is:
name1 age1 nickname1 path1
name2 age2 nickname2 path2
file 1 example is:
abcd 13 abcd.13 /home/temp/abcd.13
efgh 15 efgh.15 /home/temp/new/efgh.15 (4 Replies)
Discussion started by: alrinno
4 Replies
8. UNIX for Dummies Questions & Answers
Hi All.,
i have a problem. I hope i can get some help on this issue here;
i have 2 txt files say file1 and file 2
file1 has;
WLMT:XXXXXXXX:cp
DOLR:YYYYYYY:ascii,unblock
WLG:TTTTTTT:dd:73:ascii,unblock
MAR:SSSSSS:dd:152:ascii,unblock
GGG:QQQQQQQQQQ:112:ascii,unblock
EIE:CCCCCCCC:cp... (17 Replies)
Discussion started by: pavan_test
17 Replies
9. Shell Programming and Scripting
How do I make the below ksh to process all of the files inside a user specified directory?
Currently it can only process one file at a time.
#!/bin/ksh
tr -s '\11 ' ' ' < $1 > temp0
sed -e 's/,//g' temp0 > temp1
cut -d' ' -f1,4,5 temp1 > final_output
rm temp0 temp1 (3 Replies)
Discussion started by: stevefox
3 Replies
10. Shell Programming and Scripting
Hi all
Trying to run my korn shell script, I got no messages after the sftp.
The "finished" msg is not being displayed.
Any ideas?
sftp $argument <<EOF
quit
EOF
echo "finished"
Thanks in advance,
:O) (1 Reply)
Discussion started by: alienET
1 Replies