The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
listing files on remote server vasuarjula AIX 3 06-02-2008 03:23 PM
rename files in remote server via ftp dineshr85 Shell Programming and Scripting 4 02-20-2008 12:30 PM
delete files on a remote server bond_bhai UNIX for Advanced & Expert Users 1 07-27-2007 07:19 AM
FTP multiple files from remote server to local server berlin_germany Shell Programming and Scripting 2 12-20-2006 03:24 AM
copying files to a remote aix server using tar! system-admin AIX 2 11-17-2006 03:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-01-2006
srinivasaraju.m srinivasaraju.m is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 2
Angry How to combine two flat files which are there in remote server ?

I have to write a script in informatica, which is used to combine two remote flat files

Last edited by srinivasaraju.m; 08-01-2006 at 08:04 AM.. Reason: mistake in title
  #2 (permalink)  
Old 08-04-2006
inquirer's Avatar
inquirer inquirer is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 79
file transfer the file using ftp then perform cat command to combine files

Code:
ftp -ivn << eof
open <ip address>
user <username> <password>
binary
get file1
bye
eof

cat file1 file2 > outfile
  #3 (permalink)  
Old 08-04-2006
srinivasaraju.m srinivasaraju.m is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 2
Thanks for ur reply

Hi

Thanks.

Mean while i tried with the following script. Please let me know ur comments on this.
Code:
FTPSVR=IP address
FTPUSR=username
FTPPWD=password
FTPDIR=/dir path
export FTPSRV FTPUSR FTPPWD FTPDIR

ftp -n $FTPSVR << !
quote user $FTPUSR
quote pass $FTPPWD
cd $FTPDIR
lcd /dir name

get filename1
get filename2

bye


The second script as,

FTPSVR=IP address
FTPUSR=username
FTPPWD=password
FTPDIR=/dir path
export FTPSRV FTPUSR FTPPWD FTPDIR


cd /tmp

cat filename1  filename2 > filename3

ftp -n $FTPSVR << !
quote user $FTPUSR
quote pass $FTPPWD
cd $FTPDIR
lcd /dir name
put filename3
bye

Last edited by blowtorch; 08-04-2006 at 03:33 AM.. Reason: add code tags
  #4 (permalink)  
Old 08-04-2006
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

Join Date: Mar 2006
Location: India
Posts: 255
As in your first post you said you need to combine two flat files residing at remote host.that can be done with this script
Code:
#this script login to remote server and execute the command there the log file will be
#session_output
( echo "user"
  sleep 2
  echo "password"
  sleep 2
  echo "cd /dir_path"
  sleep 2
  echo "cat test11.txt test12.txt>>try.txt"
  sleep 2
  echo "logout"
) | telnet ip_address > session_output
Do you need to ftp also??
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0