I have a file which is ftp-ed from a VMS server to my AIX box. Since it has the ";x" value on the end of the file name from VMS, my gpg encryption is failing ... it thinks that the ';' is a command line separator and then can't find the file to encrypt.
I've come up with the following:
This gives me the 'correct' file name in tmp2 (there is only one file in the directory so only the one file name in tmp1).
What I'm not able to figure out is how to do a cp in the .ksh script to copy the original file (name in tmp1) to the new file (name in tmp2).
Example:
File pulled from VMS is called abd_082505.dat;5 . After the script piece above runs, tmp1 contains abd_082505.dat;5 while tmp2 contains abd_082505.dat . I want to copy abd_082505.dat;5 to abd_082505.dat, effectively renaming the file my gpg routine can't handle to one that it can.
Thoughts/comments/suggestions greatfully acknowledged and appreciated.
Tnx.
Tom
"My mind is like a steel whatchamacallit ...
I've come up with the following:
Code:
#!/bin/ksh
rm -f tmp*
ls OLY* > tmp1
awk 'BEGIN{FS=OFS=";"}{print $1}' tmp1 > tmp2
This gives me the 'correct' file name in tmp2 (there is only one file in the directory so only the one file name in tmp1).
What I'm not able to figure out is how to do a cp in the .ksh script to copy the original file (name in tmp1) to the new file (name in tmp2).
Example:
File pulled from VMS is called abd_082505.dat;5 . After the script piece above runs, tmp1 contains abd_082505.dat;5 while tmp2 contains abd_082505.dat . I want to copy abd_082505.dat;5 to abd_082505.dat, effectively renaming the file my gpg routine can't handle to one that it can.
Thoughts/comments/suggestions greatfully acknowledged and appreciated.
Tnx.
Tom
"My mind is like a steel whatchamacallit ...