I was writing a script that will FTP files to destination folder. All configuration should be done through a properties files and the main script will read the values from the properties file.
the properties file should contain
1) Source folders
2) Source file pattern
3) Destination folder
4) User id
5)remote server url
I have created the structure of the properties file also and the name of the property file would be archieve1.config
#remoteurl of the machine
Remoteurl=sfy.waly.com
# your user id
userid=youruserid
#This is the source directoy from where the files will be picked up
SrcFolders=/home/Administrator/files
#This directory path should end with a slash(/)
DestFolder=/home/Administrator/output/
#the pattern of the files
SourcefilePattern=*.txt
and now the command for sftp which I was using earlier without use of property file was..
sftp username@host <<EOF
lcd /home/dirA
cd /home/dirB
mput *.txt
exit
Thi above script works perfect and ftp the files from one folder to another within the same server but now I want to make a seprate main script file that will read the properites files as shown above that is from archieve1.config and nothing will be hard coded like username would be read from properties file etc and will sftp files from one folder to another within that server , so how would be the main script file ..please guide me..!!