Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: From: "Millaway, John" To: cygwin AT sourceware DOT cygnus DOT com Subject: 1.1.4: Shell escape inconsistency with activestate perl Date: Thu, 28 Sep 2000 16:28:31 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" This command, perl -e 'print qq($ARGV[0]\n)' '\n' should print 3 bytes, a literal '\', a literal 'n', and a newline. Under cygwin bash, it prints the four characters , "\n\n". Under linux and NT Command-prompt, it correctly prints the 3 characters, and , furthermore, if this script is placed in a file, it correctly prints the 3 chracters... which means that the perl interpreter is not broken. The purpose of the last argument, '\n', is prove that the shell is correctly ignoring escape sequences. If this is true, then I assume bash is correctly ignoring escape sequences for ALL arguments, which means the perl interpreter sees "print qq($ARGV[0]\n)" as it's script. For those of you that do not know perl, the qq() operator is like "" in bash, i.e., it interpolates escape sequences and variable names. If this script is placed in a file, it correctly prints 3 bytes. This is really odd, because it appears that the escaping is not consistent. The following is a script which shows the output under cygwin, and under CMD.EXE. The CMD.EXE output is correct. $ e:/usr/local/perl/bin/perl.exe -e 'print qq($ARGV[0]\n)' '\n' \n\n $ cmd.exe Microsoft(R) Windows NT(TM) (C) Copyright 1985-1996 Microsoft Corp. e:\tmp>e:\usr\local\perl\bin\perl.exe -e "print qq($ARGV[0]\n)" "\n" \n $ cygcheck -s -v -r Cygnus Win95/NT Configuration Diagnostics Current System Time: Thu Sep 28 15:54:26 2000 WinNT Ver 4.0 build 1381 Service Pack 4 Path: /usr/local/bin /usr/bin /bin /cygdrive/e/usr/local/perl/bin/ /cygdrive/c/WINNT/system32 /cygdrive/c/WINNT /cygdrive/e/usr/local/jdk1.3.0/bin /cygdrive/e/VAR/MSSQL7/BINN /cygdrive/e/var/pcAnywhere /cygdrive/e/ApacheGroup/Apache/src/CoreR/ SysDir: C:\WINNT\System32 WinDir: C:\WINNT HOME = `/cygdrive/e/usr/local/john' MAKE_MODE = `unix' PWD = `/tmp' USER = `john' !E: = `E:\bin' BISONLIB = `E:/usr/share/' COMPUTERNAME = `JOHN' COMSPEC = `C:\WINNT\system32\cmd.exe' HOMEDRIVE = `C:' HOMEPATH = `\' HOSTNAME = `JOHN' HOSTTYPE = `i586' JAVA_HOME = `E:\usr\local\jdk1.3.0' LOGONSERVER = `\\HELP' MACHTYPE = `i586-pc-cygwin' MSINPUT = `C:\Program Files\MSHardware' NUMBER_OF_PROCESSORS = `1' OLDPWD = `/' OS2LIBPATH = `C:\WINNT\system32\os2\dll;' OS = `Windows_NT' OSTYPE = `cygwin' PATHEXT = `.COM;.EXE;.BAT;.CMD' PROCESSOR_ARCHITECTURE = `x86' PROCESSOR_IDENTIFIER = `x86 Family 6 Model 7 Stepping 3, GenuineIntel' PROCESSOR_LEVEL = `6' PROCESSOR_REVISION = `0703' PROMPT = `$P$G' PS1 = `]0;\w \u@\h \w $ ' SHELL = `/bin/sh' SHLVL = `1' SYSTEM32 = `C:\WINNT\System32' SYSTEMDRIVE = `C:' SYSTEMROOT = `C:\WINNT' TEMP = `/cygdrive/c/TEMP' TERM = `cygwin' TOMCAT_HOME = `E:\ApacheGroup\jakarta-tomcat' USERDOMAIN = `INTERSPHERE' USERNAME = `john' USERPROFILE = `C:\WINNT\Profiles\john' VIM = `E:/usr/local/vim/' WINDIR = `C:\WINNT' WINDOWS = `C:\WINNT' _ = `/bin/cygcheck' TZ = `EST5EDT4,M4.1.0/2,M10.5.0/2' HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 (default) = `/cygdrive' cygdrive flags = 0x00000020 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/ (default) = `E:/' flags = 0x00000002 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/mnt/cdrom (default) = `f:' flags = 0x00000000 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/mnt/floppy (default) = `a:' flags = 0x00000000 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin (default) = `E:/bin' flags = 0x00000002 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib (default) = `E:/lib' flags = 0x00000002 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2 a: fd N/A N/A c: hd FAT 2047Mb 72% CP UN d: hd FAT 2047Mb 40% CP UN e: hd FAT 2047Mb 98% CP UN f: cd CDFS 583Mb 100% CS UN NEW g: net NTFS 1553Mb 83% CP CS UN PA FC SEE h: net NTFS 15131Mb 93% CP CS UN PA FC j: net NTFS 4149Mb 26% CP CS UN PA FC m: net NTFS 19641Mb 77% CP CS UN PA FC STORAGE q: net N/A N/A r: net NTFS 2000Mb 94% CP CS UN PA FC Found: \bin\bash.exe Found: \bin\cat.exe Found: \bin\cpp.exe Found: \bin\find.exe Found: \bin\gcc.exe Found: \bin\gdb.exe Found: \bin\ld.exe Found: \bin\ls.exe Found: \bin\make.exe Found: \bin\sh.exe 586k 2000/08/29 C:\WINNT\System32\cygwin1.dll - os=4.0 img=1.0 sys=4.0 "cygwin1.dll" v0.0 ts=2000/8/3 20:53 Cygwin DLL version info: dll major: 1001 dll minor: 4 dll epoch: 19 dll bad signal mask: 19005 dll old termios: 5 api major: 0 api minor: 26 shared data: 3 dll identifier: cygwin1 mount registry: 2 cygnus registry name: Cygnus Solutions cygwin registry name: Cygwin program options name: Program Options cygwin mount registry name: mounts v2 build date: Thu Aug 3 20:53:46 EDT 2000 CVS tag: cygwin-1-1-4 shared id: cygwin1S3 83k 2000/06/11 \bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0 "cygitcl30.dll" v0.0 ts=2000/6/10 23:34 35k 2000/06/11 \bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0 "cygitk30.dll" v0.0 ts=2000/6/10 23:34 402k 2000/06/11 \bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0 "cygtcl80.dll" v0.0 ts=2000/6/10 23:30 5k 2000/06/11 \bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0 10k 2000/06/11 \bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0 "cygtclreg80.dll" v0.0 ts=2000/6/10 23:30 639k 2000/06/11 \bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0 "cygtk80.dll" v0.0 ts=2000/6/10 23:34 586k 2000/08/04 \bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0 "cygwin1.dll" v0.0 ts=2000/8/3 20:53 Cygwin DLL version info: dll major: 1001 dll minor: 4 dll epoch: 19 dll bad signal mask: 19005 dll old termios: 5 api major: 0 api minor: 26 shared data: 3 dll identifier: cygwin1 mount registry: 2 cygnus registry name: Cygnus Solutions cygwin registry name: Cygwin program options name: Program Options cygwin mount registry name: mounts v2 build date: Thu Aug 3 20:53:46 EDT 2000 CVS tag: cygwin-1-1-4 shared id: cygwin1S3 Use -h to see help about each section -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com