|
From: LRN <lr...@gm...> - 2012-10-25 18:17:12
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25.10.2012 22:09, Kraus Philipp wrote: > > Am 25.10.2012 um 17:18 schrieb Earnie Boyd: > >> On Thu, Oct 25, 2012 at 10:54 AM, Paul wrote: >>>>>> I try to run more than one command within the MinGW >>>>>> shell: cd mydir; ./configure; make; make install but >>>>>> this does not work. The cd command creates the error that >>>>>> the path does not exists, but if I run each command alone >>>>>> all commands are working. >>>>>> >>>>> >>>>> Yes, it works. The execution stops at the first failing >>>>> command. If you want the execution of the commands to >>>>> execute regardless of if they fail then you need to use || >>>>> instead of ; where || represents OR. The ; is being treated >>>>> as && which represents AND. >>>> >>>> Yes I know, but ; is correct. It seems the "cd" command >>>> fails >>> I think what Philipp is trying to say is that when he runs all >>> the commands on one line separated by a semicolon, the cd >>> command fails, causing all the commands to fail, but when he >>> runs them individually, they all work, including the cd >>> command. What he is asking is why is the cd command failing >>> when run with the other commands, as on its own it has no >>> reason to fail. >>> >> >> WJFFM: >> >> $ cd spud; ls -l; cd -; ls -l total 4 -rw-r--r-- 1 Earnie >> Administrators 20 Oct 21 13:18 a.c -rw-r--r-- 1 Earnie >> Administrators 288 Oct 21 13:19 a.o -rw-r--r-- 1 Earnie >> Administrators 502 Oct 22 13:43 b.c drwxr-xr-x 2 Earnie >> Administrators 0 Oct 23 08:43 c++ -rw-r--r-- 1 Earnie >> Administrators 129 Oct 22 14:32 c.c /home/Earnie total 4 >> drwxr-xr-x 3 Earnie Administrators 4096 Oct 23 08:43 spud > > I run this eg: > > cd C:\Users\Administrator\Documents\library\libxml2-2.9.0 ; '\' is an escape-character in bash. Which means that the path you write looks like this after bash evaluates it: C:UsersAdministratorDocumentslibrarylibxml2-2.9.0 That is, all characters preceded by '\' are escape sequences. Since these sequences don't (AFAIR) have any special significance (unlike, say, \n, \r or \t), they are resolved to normal characters by simply throwing away the '\' prefix. If you want to use '\'-separated paths, double up every occurrence of '\', like this: C:\\Users\\Administrator\\Documents\\library\\libxml2-2.9.0 when '\' is escaped, it's resolved literary to '\'. That said, these escapes can creep up on you pretty quickly, and you have to know how many times given command will be evaluated by something that considers '\' to be escape character (which is pretty much everything except for Windows shell) to know how many times you need to escape backslashes. It's simpler (MUCH simpler) to use '/'-seprated paths, such as this: C:/Users/Administrator/Documents/library/libxml2-2.9.0 MSYS understands them just fine. If the path is produced by external entity (a script), fix that script to replace '\' with '/' in all paths. Even Windows shell has enough string-processing capabilities to do that. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBAgAGBQJQiYIXAAoJEOs4Jb6SI2Cw2oAIAJtGVGg+qjBTk1sC1D5/H5uz iIEwy0+bYB5hLY8n7HiLSBaq3CWK5sv5nS2oY5F84hXW3BXIMczJHeGh1G0I1I09 6pTP/hJRKZC8BD1nMICDikbEayX2QESunJlOuRtMpe81jUAZ2EEHiEwj8QV/p0Jy WdUZSMbx5JUDK11Soh9IrxLgSL29WW8FIfCDtJ2P5wSBGlpanF0gJlkQSMMWC4JU 7hPMK9c6i0MctStu7tQlbs3HvKbhxYiyf0AykUKnX1NecAqwOw9Un/rzYnF/KMAw rh1uZb5/hi9GYXqRLqVeDigKpPN2tnpe0n7xgK0dObJtDpMAtUg/KmHMKMzfWC8= =1r88 -----END PGP SIGNATURE----- |