delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/30/11:59:44

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: Phil Smith <phil AT voltage DOT com>
To: Jay <jay DOT krell AT cornell DOT edu>, "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>,
"stephan DOT mueller AT microsoft DOT com" <stephan DOT mueller AT microsoft DOT com>
Date: Sat, 30 Aug 2008 08:57:29 -0700
Subject: RE: Probably stupid make question (cmd a=b)
Message-ID: <B870629719727B4BA82A6C06A31C291207429E0915@hqmailsvr01.voltage.com>
References: <1220079853 DOT 15427 DOT ezmlm AT cygwin DOT com> <COL101-W69299EA7E887774F7EEC73E6620 AT phx DOT gbl>
In-Reply-To: <COL101-W69299EA7E887774F7EEC73E6620@phx.gbl>
Accept-Language: en-US
acceptlanguage: en-US
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=4.65.7161:2.4.4,1.2.40,4.0.164 definitions=2008-08-30_01:2008-08-28,2008-08-29,2008-08-30 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=3.1.0-0805090000 definitions=main-0808300059
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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 m7UFxhKS005857

Thanks for the good ideas.

The Makefile is generated by CMake, and I don't have (or know that I have) a way to force the quotes in there. Wish I did.

Yeah, I'm probably going to wind up using Perl. A quick question (obviously I can figure this out, but if I knew offhand it would save me some hassle): does Perl handle arguments such as long filenames as single arguments, as .bat does? That's the *only* good thing about .bat AFAICT:

 -Dsomething=c:\Documents and Settings\whatever

comes in as %1 or whatever (or would, if the equals sign didn't get eaten!).  If Perl is going to get the above as 3 arguments, then it's going to be a LOT more work to make it handle things correctly.  After fighting with this for more time than I care to think about, I guess I'm hoping to get an idea of how big the remaining hill is!

...phsiii
-----Original Message-----
From: jayk123 AT hotmail DOT com [mailto:jayk123 AT hotmail DOT com] On Behalf Of Jay
Sent: Saturday, August 30, 2008 10:48 AM
To: cygwin AT cygwin DOT com; Phil Smith; stephan DOT mueller AT microsoft DOT com
Subject: RE: Probably stupid make question (cmd a=b)


  continuing somewhat off topic:

  > Probably stupid make question
  > 144097 by: Phil
  > 144106 by: Stephan


>>>>>  But really, just about anything is better than cmd.   <<<<


 Have you tried quotes?

  D:\>type 2.cmd
  @echo 1 is %1
  @echo 2 is %2


  D:\>.\2.cmd a=b
  1 is a
  2 is b

  D:\>.\2.cmd "a=b"
  1 is "a=b"
  2 is


  I think tilde is how to strip quotes:
    echo 1 is %~1
    echo 2 is %~2
  to echo without quotes

  echo 1 is "%~1"
  echo 2 is "%~2"

  to echo with one set of quotes, no matter if the input was quoted.
  Though this might go badly if the last character is a blackslash, it might
   escape the quote. I find anything involving "quoting" to be broken.
   It is difficult/impossible to know how many rounds of unquoting will occur,
    and how/by whom. It seems that a large percentage of cmd and bash
    code is merely fighting to get quoting right. A lot of this stems from the
    bogus construct of representing an array of strings as one string with
    spaces delimiting elements.


  But really, just about anything is better than cmd.
  I have used cmd a lot and I heartily recommend Perl or Python instead,
   no matter the application.


 I do like cmd for interactive use, it is fast, has decent command line editing,
   history, quickedit (I wish I could triple click for lines), and my favorite feature
   F8 does completion against command line history.


  But as a programming language, it is terrible. It is too string based.


  People complain about the need to install Perl/Python on Windows, that they aren't "built in".
  Yes, but the alternative, using cmd, is much worse than having to install them.
  Perl can just be copied around, no need to "install" it.
  Python I haven't tried that yet.


 - Jay

--
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