×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

shell script

shell script

shell script

(OP)
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
 

RE: shell script

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?
 

RE: shell script

(OP)
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

RE: shell script

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:

http://www.tek-tips.com/viewthread.cfm?qid=1541556&page=1

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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close