delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/12/15:22:48

X-Spam-Check-By: sourceware.org
From: wu_xiaomin AT emc DOT com
MIME-Version: 1.0
Subject: Could not touch file when specify full path in Cygwin in .bat file
Date: Mon, 12 Jun 2006 15:22:05 -0400
Message-ID: <38EA73F8F9C1844FA2ECE82DEE237F3C224E34@CORPUSMX40B.corp.emc.com>
To: <cygwin AT cygwin DOT com>
Cc: <Balasundaram_Priya AT emc DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k5CJMhF4008303

Hi, Cygwin support group,

I have problem to touch a file when specify the full path. Here are some examples. MKS works fine


-- Filename with special characters
D:\>touch D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\!@#$%&()_+.!@#$%&()_+
) was unexpected at this time.

-- With the quote on filename
D:\>touch D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\"!@#$%&()_+.!@#$%&()_+"

touch: cannot touch `D:\\usr\\meta\\boxster\\UNITw2kMixednew\\boxster_UNITw2kMixednew_0205\\Tree\\!@#$%&()_+.!@#$%&()_+': No such file or directory

-- We can touch a file with the double quota in DOS cmd window.
D:\>touch  "D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\!@#$%()_+.!@#$%&()_+"

D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree>ls

!@#$%()_+.!@#$%&()_+



--- If we put this touch command in windows batch file -- (clone.bat) file, it won't work.

SET TEST_SERVER=D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree
touch "%TEST_SERVER%\!@#$%%^&()_+.!@#$%%^&()_+"                     <== (we try touch without quote, same result)

--- run .bat file
D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205>cmd /c clone.bat
touch: cannot touch `D:\\usr\\meta\\boxster\\UNITw2kMixednew\\boxster_UNITw2kMixednew_0205\\Tree\\!@#$%^&()_+.!@#$%^&()_+': No such file or directory


Do you know why is that and how do we make it work in .bat file?

Thanks a lot for your help!

Xiaomin

EMC˛ 
Where Information Lives
Xiaomin Wu
Phone#: 508-305-8783
Ext: 48783
E-mail: wu_xiaomin AT emc DOT com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019