Operating System - HP-UX
1834055 Members
2552 Online
110063 Solutions
New Discussion

converting filenames using sed

 
SOLVED
Go to solution
Kris_5
Occasional Advisor

converting filenames using sed

Hi Folks,

I need your help again. I am trying to move files from VMS to unix. These files are moved to a temporary staging area on unix and will then be moved on to final Unix target area.

for example,
the file $$rxdata_af.bck need to be moved onto target area, but the I can't use the following command directly(as unix interprets the $$ as pid).
mv $$rxdata_af.bck /data/$$rxdata_af.bck
So, I need to add \\ to the beginning of each symbols like $ ; etc. Please help me constructing a simple sed command to prefix a \ to these special charcters.

Note that we can not predict how many times the $ will repeat in a file name.

TIA,

Kris
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: converting filenames using sed

Hi Kris:

Simply put single quote marks around your filename so the shell doesn't interpret them:

# mv '$rxdata_af.bck' '/data/$$rxdata_af.bck'

Regards!

...JRF...
harry d brown jr
Honored Contributor

Re: converting filenames using sed

VMS has rcp!

I used to use it all the time!

Also, this might be of help:

http://www-focus.fnal.gov/dart/imp.html


live free or die
harry
Live Free or Die