Hi,
I orginally posted in Sun Solaris (apologies, now reposting in UNIX Scripting)
Would like to use /bin/sh
*nix version FreeBSD
I would like to parse the contents of a text file. This text file is built from a sql query.
/text_file.txt
Contents of text_file.txt would be:
012YYYYMMDDHHMMSS
012YYYYMMDDHHMMSS
012YYYYMMDDHHMMSS
each line will have a unique 'YYYYMMDDHHMMSS'
I will need to append .tar to each line and rcp to another server.
But, I will need to use the YYYYMMDD to specify target and source directory for the rcp command.
I also need to break up the YYYYMMDD into /YYYY/MM/DD/ as the file is stored this way in the filesystem (/YYYY/MM/DD/012YYYYMMDDHHMMSS.tar
Then use this to copy the file using rcp, then changing the permissions once it has copied to the other server.
For example:
rcp -p file.tar user@host:file.tar
rsh -l user host "chmod 755 file.tar"
Any help would be greatly appreciated!
Thanks!
I orginally posted in Sun Solaris (apologies, now reposting in UNIX Scripting)
Would like to use /bin/sh
*nix version FreeBSD
I would like to parse the contents of a text file. This text file is built from a sql query.
/text_file.txt
Contents of text_file.txt would be:
012YYYYMMDDHHMMSS
012YYYYMMDDHHMMSS
012YYYYMMDDHHMMSS
each line will have a unique 'YYYYMMDDHHMMSS'
I will need to append .tar to each line and rcp to another server.
But, I will need to use the YYYYMMDD to specify target and source directory for the rcp command.
I also need to break up the YYYYMMDD into /YYYY/MM/DD/ as the file is stored this way in the filesystem (/YYYY/MM/DD/012YYYYMMDDHHMMSS.tar
Then use this to copy the file using rcp, then changing the permissions once it has copied to the other server.
For example:
rcp -p file.tar user@host:file.tar
rsh -l user host "chmod 755 file.tar"
Any help would be greatly appreciated!
Thanks!