From: Kraus P. <phi...@fl...> - 2012-10-25 08:39:11
|
Hello, 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. How can I concat the commands, so that are run one after another? On Linux I use the ; for seperating each command. Thanks Phil |
From: Cristiano S. <sum...@gm...> - 2012-10-25 11:34:30
|
Use an absolute path or prepend a mkdir command first or do a path check before. This is not a mingw problem. cd is failing and interpreter maybe halting on it. 2012/10/25 Kraus Philipp <phi...@fl...> > Hello, > > 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. > > How can I concat the commands, so that are run one after another? On Linux > I use the ; for seperating each > command. > > Thanks > > Phil > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list > etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe > |
From: Earnie B. <ea...@us...> - 2012-10-25 13:11:21
|
On Thu, Oct 25, 2012 at 4:43 AM, Kraus Philipp wrote: > Hello, > > 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. > How can I concat the commands, so that are run one after another? On Linux I use the ; for seperating each > command. The MSYS shell is bash which is usually what you would use on Linux. And on Linux a failing command will stop the execution of the multiple statements on one command line. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Kraus P. <phi...@fl...> - 2012-10-25 14:27:43
|
Am 25.10.2012 um 15:11 schrieb Earnie Boyd: > On Thu, Oct 25, 2012 at 4:43 AM, Kraus Philipp wrote: >> Hello, >> >> 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 Phil |
From: Paul <pau...@af...> - 2012-10-25 14:55:17
|
> >> 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. I could be wrong, I just see potential miscommunication happening... Paul |
From: Kraus P. <phi...@fl...> - 2012-10-25 15:13:28
|
Am 25.10.2012 um 16:54 schrieb Paul: >>>> 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. > > I could be wrong, I just see potential miscommunication happening... Thanks Paul, this is the correct context :-) |
From: Renato S. <br....@gm...> - 2012-10-25 18:20:09
|
2012/10/25 Paul <pau...@af...> > > >> 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. > > I could be wrong, I just see potential miscommunication happening... > Yes that's what I understood too, and he says it very clearly. |
From: Earnie B. <ea...@us...> - 2012-10-25 15:18:20
|
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 could be wrong, I just see potential miscommunication happening... Maybe but speaking in generalities does not help the communication. My guess is that the multi-statement command line has a mis-typed directory name where the line by line has it typed correctly. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Kraus P. <phi...@fl...> - 2012-10-25 18:05:28
|
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 ; or the same with relative path names and I get the error: Das System kann den angegebenen Pfad nicht finden. (The system can not found this path) I can run the command also with unix style path names /c/.... The cd command fails all the time if the semicolon is at the end. If I remove it, the cd will be executated without any errors >> I could be wrong, I just see potential miscommunication happening... > > Maybe but speaking in generalities does not help the communication. > My guess is that the multi-statement command line has a mis-typed > directory name where the line by line has it typed correctly. The path exists, but the problem seems to be the ";" at the end of the cd command Phil |
From: Earnie B. <ea...@us...> - 2012-10-25 18:50:42
|
On Thu, Oct 25, 2012 at 2:09 PM, Kraus Philipp <phi...@fl...> 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 ; > > or the same with relative path names and I get the error: > > Das System kann den angegebenen Pfad nicht finden. > (The system can not found this path) > LRN gave the reason why this happens, I won't rehash that out. > I can run the command also with unix style path names /c/.... > > The cd command fails all the time if the semicolon is at the end. > If I remove it, the cd will be executated without any errors > Can you create a batch file of the commands that show the cd failing and not failing and attach it to the post back to this list? I'm having a hard time believing that it isn't working with ; and is without. -- Earnie -- https://sites.google.com/site/earnieboyd |
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----- |
From: Renato S. <br....@gm...> - 2012-10-25 18:47:23
|
2012/10/25 LRN <lr...@gm...> > '\' 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. > > Right, and even Windows understands forward slashes, for example: cmd.exe> cd ../.. However, when you pass a non-existent directory to cd, error message is like this not what he said: bash.exe: cd: <non-existent>: No such file or directory So Philipp, try renaming the directory and run cd to old name in separate line, then is it the same error as you have said or like the one above? Also, what do you mean with I can run the command also with unix style path names? You can successfully, or you can try but doesn't work either? |
From: Renato S. <br....@gm...> - 2012-10-25 18:25:00
|
2012/10/25 Earnie Boyd <ea...@us...> > On Thu, Oct 25, 2012 at 4:43 AM, Kraus Philipp wrote: > > Hello, > > > > 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. > > > How can I concat the commands, so that are run one after another? On > Linux I use the ; for seperating each > > command. > > The MSYS shell is bash which is usually what you would use on Linux. > And on Linux a failing command will stop the execution of the multiple > statements on one command line. > > What? Desktop $ cd non-existent; cd failed-again; echo $wat bash.exe: cd: non-existent: No such file or directory bash.exe: cd: failed-again: No such file or directory ; does not skip on errors Desktop $ cd non-existent || echo failed bash.exe: cd: non-existent: No such file or directory failed Desktop $ cd non-existent && echo success bash.exe: cd: non-existent: No such file or directory Desktop $ mkdir non-existent Desktop $ cd non-existent && echo success success non-existent $ |
From: Earnie B. <ea...@us...> - 2012-10-25 18:46:31
|
On Thu, Oct 25, 2012 at 2:24 PM, Renato Silva wrote: > 2012/10/25 Earnie Boyd <ea...@us...> >> >> On Thu, Oct 25, 2012 at 4:43 AM, Kraus Philipp wrote: >> > Hello, >> >> > >> > 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. >> >> > How can I concat the commands, so that are run one after another? On >> > Linux I use the ; for seperating each >> > command. >> >> The MSYS shell is bash which is usually what you would use on Linux. >> And on Linux a failing command will stop the execution of the multiple >> statements on one command line. >> > > What? > > Desktop $ cd non-existent; cd failed-again; echo $wat > bash.exe: cd: non-existent: No such file or directory > bash.exe: cd: failed-again: No such file or directory > ; does not skip on errors > Oh, well, I was wrong about my assumptions and you know what that say about assuming something. > Desktop $ cd non-existent || echo failed > bash.exe: cd: non-existent: No such file or directory > failed > As expected. > Desktop $ cd non-existent && echo success > bash.exe: cd: non-existent: No such file or directory > As expected > Desktop $ mkdir non-existent > Desktop $ cd non-existent && echo success > success > non-existent $ > As expected. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Eli Z. <el...@gn...> - 2012-10-25 19:35:34
|
> From: Renato Silva <br....@gm...> > Date: Thu, 25 Oct 2012 16:46:35 -0200 > > Right, and even Windows understands forward slashes, for example: > cmd.exe> cd ../.. Only sometimes, so this is unreliable; caveat emptor! E.g.: D:\usr\eli\data>cd d:/usr The system cannot find the path specified. D:\usr\eli\data>cd /usr The system cannot find the path specified. (As you can see from the prompt, that directory does exist.) It looks like it only recognizes relative directory names with forward slashes. |
From: Renato S. <br....@gm...> - 2012-10-25 21:08:17
|
2012/10/25 Eli Zaretskii <el...@gn...> > > From: Renato Silva <br....@gm...> > > Date: Thu, 25 Oct 2012 16:46:35 -0200 > > > > Right, and even Windows understands forward slashes, for example: > > cmd.exe> cd ../.. > > Only sometimes, so this is unreliable; caveat emptor! E.g.: > > D:\usr\eli\data>cd d:/usr > The system cannot find the path specified. > D:\usr\eli\data>cd /usr > The system cannot find the path specified. > > (As you can see from the prompt, that directory does exist.) > > It looks like it only recognizes relative directory names with forward > slashes. > > That seems an specific (and annoying) bug with cmd.exe, since it seems to work only if you run cd from drive root. NTFS and Windows API, however, should handle them ok. It's similar to when you can't create or rename files starting with dots in explorer, but it's supported just fine otherwise (for example, create one with bash then edit with notepad, delete from explorer etc.). |
From: Eli Z. <el...@gn...> - 2012-10-26 07:15:24
|
> From: Renato Silva <br....@gm...> > Date: Thu, 25 Oct 2012 19:07:29 -0200 > > 2012/10/25 Eli Zaretskii <el...@gn...> > > > > From: Renato Silva <br....@gm...> > > > Date: Thu, 25 Oct 2012 16:46:35 -0200 > > > > > > Right, and even Windows understands forward slashes, for example: > > > cmd.exe> cd ../.. > > > > Only sometimes, so this is unreliable; caveat emptor! E.g.: > > > > D:\usr\eli\data>cd d:/usr > > The system cannot find the path specified. > > D:\usr\eli\data>cd /usr > > The system cannot find the path specified. > > > > (As you can see from the prompt, that directory does exist.) > > > > It looks like it only recognizes relative directory names with forward > > slashes. > > > > > That seems an specific (and annoying) bug with cmd.exe What bug are you alluding to? I see no bug in the examples I posted" "cd", the cmd.exe internal command, is not advertised as supporting forward slashes in file names. We are lucky it sometimes work. > since it seems to work only if you run cd from drive root. What "seems to work only if you run cd from drive root"? Can you show an example of what works and what doesn't work? > NTFS and Windows API, however, should handle them ok. If you mean forward slashes, yes. But the problem is, some commands interpret their arguments before passing them to the APIs. E.g., "cd" supports options, like "/d", so it looks at its argument to see if these switches are specified. |
From: Earnie B. <ea...@us...> - 2012-10-26 11:46:39
|
On Fri, Oct 26, 2012 at 3:15 AM, Eli Zaretskii wrote: >> From: Renato Silva >> Date: Thu, 25 Oct 2012 19:07:29 -0200 >> >> 2012/10/25 Eli Zaretskii >> >> > > From: Renato Silva >> > > Date: Thu, 25 Oct 2012 16:46:35 -0200 >> > > >> > > Right, and even Windows understands forward slashes, for example: >> > > cmd.exe> cd ../.. >> > >> > Only sometimes, so this is unreliable; caveat emptor! E.g.: >> > >> > D:\usr\eli\data>cd d:/usr >> > The system cannot find the path specified. >> > D:\usr\eli\data>cd /usr >> > The system cannot find the path specified. >> > >> > (As you can see from the prompt, that directory does exist.) >> > >> > It looks like it only recognizes relative directory names with forward >> > slashes. >> > >> > >> That seems an specific (and annoying) bug with cmd.exe > > What bug are you alluding to? I see no bug in the examples I posted" > "cd", the cmd.exe internal command, is not advertised as supporting > forward slashes in file names. We are lucky it sometimes work. > What Windows OS? The only failure I could produce on Windows 7 was if I created a directory named d in the root of the drive. Now on my older XP if I cd /somedir then it changes to the directory but if I cd /somedir/subdir then I get an error that it can't find the path. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Eli Z. <el...@gn...> - 2012-10-26 13:18:52
|
> Date: Fri, 26 Oct 2012 07:46:32 -0400 > From: Earnie Boyd <ea...@us...> > > On Fri, Oct 26, 2012 at 3:15 AM, Eli Zaretskii wrote: > >> From: Renato Silva > >> Date: Thu, 25 Oct 2012 19:07:29 -0200 > >> > >> 2012/10/25 Eli Zaretskii > >> > >> > > From: Renato Silva > >> > > Date: Thu, 25 Oct 2012 16:46:35 -0200 > >> > > > >> > > Right, and even Windows understands forward slashes, for example: > >> > > cmd.exe> cd ../.. > >> > > >> > Only sometimes, so this is unreliable; caveat emptor! E.g.: > >> > > >> > D:\usr\eli\data>cd d:/usr > >> > The system cannot find the path specified. > >> > D:\usr\eli\data>cd /usr > >> > The system cannot find the path specified. > >> > > >> > (As you can see from the prompt, that directory does exist.) > >> > > >> > It looks like it only recognizes relative directory names with forward > >> > slashes. > >> > > >> > > >> That seems an specific (and annoying) bug with cmd.exe > > > > What bug are you alluding to? I see no bug in the examples I posted" > > "cd", the cmd.exe internal command, is not advertised as supporting > > forward slashes in file names. We are lucky it sometimes work. > > > > What Windows OS? XPSP3. I now tried on Windows 7, and there it does work with absolute directory names as well. There's something to learn every day. |
From: Renato S. <br....@gm...> - 2012-12-15 20:58:43
|
2012/10/26 Renato Silva <br....@gm...> > 2012/10/26 Eli Zaretskii <el...@gn...> > >> > That seems an specific (and annoying) bug with cmd.exe >> >> >> What bug are you alluding to? I see no bug in the examples I posted" >> "cd", the cmd.exe internal command, is not advertised as supporting >> forward slashes in file names. We are lucky it sometimes work. >> > > It should either support or not support, it shouldn't work sometimes at > arbitrary situations. > > >> > since it seems to work only if you run cd from drive root. >> >> What "seems to work only if you run cd from drive root"? Can you show >> an example of what works and what doesn't work? >> > > Cd with forward slashes, it seems to work fine in Windows 7 but not in XP, > example: > > C:\Usuários> cd "C:/Programas/MinGW" > > The system cannot find the path specified. > C:\Usuários> cd C:\ > C:\> cd "C:/Programas/MinGW" > C:\Programas\MinGW> > > >> >> > NTFS and Windows API, however, should handle them ok. >> >> If you mean forward slashes, yes. But the problem is, some commands >> interpret their arguments before passing them to the APIs. E.g., "cd" >> supports options, like "/d", so it looks at its argument to see if >> these switches are specified. >> > > Then that's a problem specific to the program you're trying to use. I mean > when writing programs and scripts themselves, for example you should be > able to use forward slashes just fine in Python or Ruby scripts, or your > MinGW programs, becasue they won't use the cd command or whatever, but the > Windows API (indirectly through MSVCRT). Of course it doesn't eliminate the > drive letter problem, but it should avoid lot of trouble already on > relative paths and if you attach a prefix with different roots between > Windows and unixes. Old thread but just to avoid confusion, resending the above message wrongly sent to specific recipient instead of the list. |