Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell script

Status
Not open for further replies.

fmmutale

MIS
Oct 13, 2008
12
NG
Hello All,

I need help again. I have surfing on the net to find a solution but I have not found any as at now.

Can any do the following:
* That will ftp a file from one User account to another on the same server.
* the same script should run a 4GL (.4ge) program to check that the file is not empty and update infornmation on the database file
* unload updated information

I am quite new to script writing and I find this quite challenging. We are trying to avoid manual intervention at every stage.

Your help will greatly be appreciated.

Thanking you in advance.


Regards.


Felix Mwango Mutale
 
My first question is why do you want to ftp a file if you are on the same server? Why not just copy it?

My second question is does the 4GL program already exist and functioning?
 
Hello Sir,

Thanks for the reply and questions. Firstly I want to FTP a file from one user account into another although it is on the same machine.

We have Develop our Systems in Informix 4gl, on Unix flatfoam and now we want to migrate to Linux. Alll we are trying to do is to enhance optimise/automate some operations instead of doing them manually.

I Ican manage to write a script that, can do FTP, Unload files and check that the unloaded file is not empty, in the same script, run a 4GL program to pick the unloaded file and run the update.

I hope you understand what I am trying to do.

Thanks.


Felix Mwango Mutale
 
I say again: why do you want to FTP file from a user on the same server? It seems silly to me when you can just copy the file???

Anyway, I have never written a unix script using FTP. Check out this link; maybe it can help you:


You can use this script as a template to get you going:

Code:
#!/bin/bash

cd <to/your/directory/containing/the/4gl/executable>

# execute your FTP or copy command to get your file

# if the file exists and it is a regular file
if [[ -f <your file>  ]]
then
   <execute your 4GL executable>
fi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top