Exporting Files from Unix to a Windows Platform


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Exporting Files from Unix to a Windows Platform
# 1  
Old 08-27-2008
Exporting Files from Unix to a Windows Platform

I was able to convert my csv file in Unix to xls. I would like to export the converted xls file to a windows environment. I have to manually connect using the following below:
ftp: 192.x.x.x -> username/pass -> cd -> mget *.xls and then confirm.

Could I automate this process into a shell script?
# 2  
Old 08-27-2008
Tools Maybe this will get you started...

Here is a section of one of my scripts:
Code:
# build the ftp command string
echo "user" $slog $spwd >$ftp_in
echo 'cd "'"$idir"'"' >>$ftp_in
echo "put" "$ifil" >>$ftp_in
echo "dir" "$ifil" >>$ftp_in
echo "quit" >>$ftp_in

# do the file transfer
ftp -v -n "$sipn" <$ftp_in >$ftp_log

# show verification information
echo "** file verification on remote system **"
ls -l "$ifil"
cat $ftp_log | grep ^[0-9] | grep "$ifil"$
echo "**"

slog = login username
spwd = login password
idir = directory to change to
ifil = file to upload
sipn = ip address to ftp connect to

And I do show the orginal file & size info, and for the ftp version -- allowing me to see that the ftp was successful
# 3  
Old 08-28-2008
Thanks for the reply!

I'm certain this is going to work!

My question is: Do I need to enter these variables first, or it doesn't matter?
slog = login username
spwd = login password
idir = directory to change to
ifil = file to upload
sipn = ip address to ftp connect to

Should it be for each variable:
slog=, or $slog=

Thanks
# 4  
Old 08-28-2008
Hammer & Screwdriver The variables would all need to be defined earlier

The following shows two ways they could be set:
Code:
# read the parameters
isrv="$1"
idir="$2"
ifil="$3"

# determine data for server
# add more servers here
if [ "$isrv" = "ms" ]
   then
   sipn="10.10.10.10"
   slog="br"
   spwd="Br"
fi

I set the first three as input parameters. (think script server dir file as command input)
I then set three more based on an if-then construct.
# 5  
Old 09-02-2008
I think this is what I need, but to be honest, I'm new with the Unix Scripting, so I'll need some time to educated myself a bit before attempting this awesome layout.

Thank you again and I'm working on it, will report back soon!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Exporting display to windows machine

hello all, I have been googling alot about my problem and finally thought to post a question. server: SunOS 5.1 64bit pn Sun Netra 240 i need to run an application which shows a gui tool but i believe SunOS cant show the GUI so i need to export the display to my system which is running... (3 Replies)
Discussion started by: wonderwall
3 Replies

2. Shell Programming and Scripting

UNIX command to copy files from Windows to UNIX box

Hi Folks, I have a file name abc.xml in my windows machine at the location c:\ytr\abc.xml which I want to place at the unix box machine inside cde directory.. at the following location that is /opt/app/cde/ now the credentials of unix box are abc345 -->(dummyid) ftyiu88--->(dummy passwd) ... (4 Replies)
Discussion started by: punpun66
4 Replies

3. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

4. Red Hat

Help with exporting DISPLAY from Linux to Windows XP

Hi Experts, I am using Cygwin and Xming server to bring back the display from Linux to a Windows machine. I am following the below steps :- 1. Close down all X Servers 2. Run XMing – XLaunch 3. Select Multiple 4. Select Start no clients 5. Tick No Access Control box 6. Click Finish... (7 Replies)
Discussion started by: oopsalion
7 Replies

5. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

6. AIX

how to allow Windows platform to access Unix based disk volumes

How to allow Windows platform to access Unix(AIX) based disk volumes? (2 Replies)
Discussion started by: rainbow_bean
2 Replies

7. UNIX for Advanced & Expert Users

Exporting files from unix to Excel sheet

How can we export a file in unix with certain number of columns to an excel sheet. It's very useful in time saving...... (3 Replies)
Discussion started by: bishweshwar
3 Replies

8. Filesystems, Disks and Memory

Unix Sco Open Server, Windows Computers Problem Access Unix Shared Files Help!!!!!

Hello Moto I hope someone can help We's here at work, have a unix box with sco openserver 5 on it, so it has a nice gui interface.. and also a fair few windows computers.. a system admin guy b4 me, has set up a user called neil, which can, when u try to access the unix box using windows... (2 Replies)
Discussion started by: haggo
2 Replies

9. Windows & DOS: Issues & Discussions

checking the size of unix cd on windows platform

Hi, Is it possible or is there a program out there that can get the byte size of a unix cd on the windows platform. Any help would be really great with this. Thanks (2 Replies)
Discussion started by: johnjsm
2 Replies

10. UNIX for Advanced & Expert Users

Porting of Windows written unix scripts to unix platform

Can anybody help me in finding out a solution for the problem below? When we write .unix or .sh files in windows OS and port them to Unix platforms there is a character ^M inserted at the end of each line of the script file. During ftp porting I set the transfer mode as ASCII for the script... (7 Replies)
Discussion started by: tamilselvi
7 Replies
Login or Register to Ask a Question