Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with an automated name change

Status
Not open for further replies.

Dirtbike

IS-IT--Management
Dec 9, 2002
81
US
I have a credit card clearing problem. The requester is looking for a file called icver012.req but my UNIX application is presenting a file called ICVER12 .REQ (yes, that's an embedded space!) Really I think I need something that will poll for a file, change it's name and put it in another directory. The requester will then pick it up, process it, put an answer file in the interum directory, then poll for that file, rename and put in the directory the UNIX box expects.
You guys have always been spot on in the past. Thanks for those answers and your thoughts here.

Scott in Charlotte, NC
 
The root of your question is: "how to deal with filenames that have spaces in them?"

just quote them and most utilities will treat it properly.
eg.

if [ -f "/path/to/file/ICVER12 .REQ" ] ; then
mv "/path/to/file/ICVER12 .REQ" /targetpath/icver012.req
fi
 
Yes, the embedded space was one issue. The other was the ICVER12 .REQ to icver012.req in that the 0 needs to be there. My issue now is exicuting the code. How would I poll for the file in question? I'm a newbie at this UNIX stuff....although I wouldn't have much of a clue on the DOS world either!! Thanks for your input.

Scott in Charlotte, NC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top