This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unable to access file from shell script (XP configure problem?)


Hello --

I am trying to get Cygwin running under Windows XP and am running into a
problem with file access. I'm getting "No such file or directory" errors
when running some 3rd party shell scripts, and have narrowed the problem
down to what I think is a Cygwin config problem on my system.
Specifically, shell scripts don't appear to be able to read files based
on filenames passed in as commandline parameters. I've narrowed this
down to a minimal shell script that reproduces the problem, which I've
named buggy.sh as shown in this trace:

----------------------------------------------------
felciano@DURFELCIANO2 /cygdrive/c/Downloads
$ pwd
/cygdrive/c/Downloads

felciano@DURFELCIANO2 /cygdrive/c/Downloads
$ cat buggy.sh
#!/bin/sh
echo Hello "$@"
cat "$@"
echo Bye!

felciano@DURFELCIANO2 /cygdrive/c/Downloads
$ cat /cygdrive/c/Downloads/ramon.txt
alpha
beta
delta
gamma

felciano@DURFELCIANO2 /cygdrive/c/Downloads
$ ./buggy.sh /cygdrive/c/Downloads/ramon.txt
Hello /cygdrive/c/Downloads/ramon.txt
: No such file or directoryramon.txt
Bye!

felciano@DURFELCIANO2 /cygdrive/c/Downloads
$
---------------------------------------------------- 

There are no spaces in the filename and I'm using POSIX paths, so I
don't think that's the issue. I can clearly find and view the file from
the commandline so I don't think it is an access control or volume mount
problem in the Cygwin environment. The shell script itself sees the
command-line parameter (echo works) but the subsequent cat command fails
with a "No such file or directory" error. The thing that looks
particular odd is the error message:

----------------------------------------------------
: No such file or directoryramon.txt
----------------------------------------------------

which looks like it is an error message that overwrote the
"/cygdrive/c/Downloads/ramon.txt" pathname. 

Any suggestions on where to hunt further for a resolution? I'm running
Windows XP Professional Ver 5.1 SP2; per http://cygwin.com/problems.html
I have attached a cygcheck dump to this email.

Thanks!

Ramon

----------------------------------------------------
Cygwin Configuration Diagnostics
Current System Time: Thu Oct 25 09:03:13 2007

Windows XP Professional Ver 5.1 Build 2600 Service Pack 2

Path:	C:\cygwin\usr\local\bin
	C:\cygwin\bin
	C:\cygwin\bin
	C:\cygwin\usr\X11R6\bin
	c:\Python25\scripts\
	c:\Python25\
	c:\Program Files\Java\jdk1.6.0_02\bin
	c:\oracle\ora92\bin
	c:\Program Files\Oracle\jre\1.3.1\bin
	c:\Program Files\Oracle\jre\1.1.8\bin
	c:\WINDOWS\system32
	c:\WINDOWS
	c:\WINDOWS\System32\Wbem
	c:\Program Files\Microsoft SQL Server\90\Tools\binn\
	c:\Program Files\GnuWin32\bin\
	c:\Program Files\QuickTime\QTSystem\
	c:\PROGRA~1\ATT\Graphviz\bin
	c:\Program Files\pandoc

Output from C:\cygwin\bin\id.exe (nontsec)
UID: 11017(felciano)    GID: 10545(mkgroup-l-d)
0(root)                 544(Administrators)     545(Users)
10545(mkgroup-l-d)

Output from C:\cygwin\bin\id.exe (ntsec)
UID: 11017(felciano)    GID: 10545(mkgroup-l-d)
0(root)                 544(Administrators)     545(Users)
10545(mkgroup-l-d)

SysDir: C:\WINDOWS\system32
WinDir: C:\WINDOWS

USER = 'felciano'
PWD = '/cygdrive/c/Downloads'
CYGWIN = 'tty'
HOME = '/cygdrive/c/Documents and Settings/felciano'
MAKE_MODE = 'unix'

HOMEPATH = '\Documents and Settings\felciano'
MANPATH = '/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man'
APPDATA = 'C:\Documents and Settings\felciano\Application Data'
HOSTNAME = 'DURFELCIANO2'
TERM = 'cygwin'
PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 4 Stepping 7, GenuineIntel'
WINDIR = 'C:\WINDOWS'
OLDPWD = '/cygdrive/c'
USERDOMAIN = 'INGENUITY'
OS = 'Windows_NT'
ALLUSERSPROFILE = 'C:\Documents and Settings\All Users'
!:: = '::\'
TEMP = '/cygdrive/c/DOCUME~1/felciano/LOCALS~1/Temp'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
QTJAVA = 'C:\Program Files\Java\jre1.6.0_01\lib\ext\QTJava.zip'
USERNAME = 'felciano'
PROCESSOR_LEVEL = '15'
FP_NO_HOST_CHECK = 'NO'
SYSTEMDRIVE = 'C:'
JAVA_HOME = 'C:\Program Files\Java\jdk1.6.0_01\'
USERPROFILE = 'C:\Documents and Settings\felciano'
CLIENTNAME = 'Console'
PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
LOGONSERVER = '\\MPDC1'
PROCESSOR_ARCHITECTURE = 'x86'
!C: = 'C:\cygwin\bin'
SHLVL = '1'
USERDNSDOMAIN = 'NT.INGENUITY.COM'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
HOMEDRIVE = 'C:'
PROMPT = '$P$G'
COMSPEC = 'C:\WINDOWS\system32\cmd.exe'
TMP = '/cygdrive/c/DOCUME~1/felciano/LOCALS~1/Temp'
SYSTEMROOT = 'C:\WINDOWS'
PRINTER = '\\mpdc2\Kpp2 - HP LaserJet 5500 Series PCL'
CVS_RSH = '/bin/ssh'
PROCESSOR_REVISION = '0407'
CLASSPATH = '.;C:\Program Files\Java\jre1.6.0_01\lib\ext\QTJava.zip'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:'
PROGRAMFILES = 'C:\Program Files'
NUMBER_OF_PROCESSORS = '2'
SESSIONNAME = 'Console'
COMPUTERNAME = 'DURFELCIANO2'
SONICCENTRAL = 'C:\Program Files\Common Files\Sonic Shared\Sonic
Central\'
_ = '/usr/bin/cygcheck'
POSIXLY_CORRECT = '1'

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 = 0x00000022
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
  (default) = '/cygdrive'
  cygdrive flags = 0x00000022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = 'C:\cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = 'C:\cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = 'C:\cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

c:  hd  NTFS     76245Mb  87% CP CS UN PA FC     
d:  cd             N/A    N/A                    
p:  net NTFS     46282Mb  11% CP    UN PA        224
r:  net NTFS    196948Mb  24% CP    UN PA        222
t:  net NTFS     98473Mb  25% CP    UN PA        219
u:  net NTFS    547976Mb  55% CP    UN PA        359

.              /cygdrive  user    binmode,cygdrive
C:\cygwin      /          system  binmode
C:\cygwin/bin  /usr/bin   system  binmode
C:\cygwin/lib  /usr/lib   system  binmode
.              /cygdrive  system  binmode,cygdrive

Found: C:\cygwin\bin\awk.exe
Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Found: C:\cygwin\bin\cp.exe
Not Found: cpp (good!)
Not Found: crontab
Found: C:\cygwin\bin\find.exe
Not Found: gcc
Not Found: gdb
Found: C:\cygwin\bin\grep.exe
Found: C:\cygwin\bin\kill.exe
Not Found: ld
Found: C:\cygwin\bin\ls.exe
Not Found: make
Found: C:\cygwin\bin\mv.exe
Not Found: patch
Not Found: perl
Found: C:\cygwin\bin\rm.exe
Found: C:\cygwin\bin\sed.exe
Not Found: ssh
Found: C:\cygwin\bin\sh.exe
Found: C:\cygwin\bin\tar.exe
Found: C:\cygwin\bin\test.exe
Not Found: vi
Not Found: vim

   61k 2006/11/10 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2006/11/10 15:42
    7k 2003/10/19 C:\cygwin\bin\cygcrypt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypt-0.dll" v0.0 ts=2003/10/19 0:57
 1059k 2007/10/19 C:\cygwin\bin\cygcrypto-0.9.8.dll - os=4.0 img=1.0
sys=4.0
                  "cygcrypto-0.9.8.dll" v0.0 ts=2007/10/19 4:45
  895k 2004/04/28 C:\cygwin\bin\cygdb-4.2.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb-4.2.dll" v0.0 ts=2004/4/27 8:31
 1156k 2004/04/28 C:\cygwin\bin\cygdb_cxx-4.2.dll - os=4.0 img=1.0
sys=4.0
                  "cygdb_cxx-4.2.dll" v0.0 ts=2004/4/27 8:35
  118k 2007/04/06 C:\cygwin\bin\cygexpat-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygexpat-0.dll" v0.0 ts=2007/4/6 13:43
   66k 2007/05/22 C:\cygwin\bin\cygexslt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygexslt-0.dll" v0.0 ts=2007/5/22 9:10
   40k 2006/11/15 C:\cygwin\bin\cygform-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygform-8.dll" v0.0 ts=2006/11/14 23:06
   48k 2003/08/09 C:\cygwin\bin\cygform7.dll - os=4.0 img=1.0 sys=4.0
                  "cygform7.dll" v0.0 ts=2003/8/9 2:25
  323k 2005/07/10 C:\cygwin\bin\cyggcrypt-11.dll - os=4.0 img=1.0
sys=4.0
                  "cyggcrypt-11.dll" v0.0 ts=2005/7/9 17:10
   19k 2006/11/19 C:\cygwin\bin\cyggdbm-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm-4.dll" v0.0 ts=2006/11/19 0:18
    8k 2006/11/19 C:\cygwin\bin\cyggdbm_compat-4.dll - os=4.0 img=1.0
sys=4.0
                  "cyggdbm_compat-4.dll" v0.0 ts=2006/11/19 0:18
   12k 2005/07/09 C:\cygwin\bin\cyggpg-error-0.dll - os=4.0 img=1.0
sys=4.0
                  "cyggpg-error-0.dll" v0.0 ts=2005/7/9 15:34
   25k 2007/08/23 C:\cygwin\bin\cyghistory6.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory6.dll" v0.0 ts=2007/8/23 15:01
  271k 2007/08/24 C:\cygwin\bin\cygicons-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygicons-0.dll" v0.0 ts=2007/8/24 0:24
  976k 2006/10/22 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2006/10/22 16:44
   37k 2003/08/10 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-2.dll" v0.0 ts=2003/8/10 14:50
   31k 2005/11/20 C:\cygwin\bin\cygintl-3.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-3.dll" v0.0 ts=2005/11/19 18:04
   31k 2006/10/23 C:\cygwin\bin\cygintl-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-8.dll" v0.0 ts=2006/10/22 17:12
   21k 2006/11/15 C:\cygwin\bin\cygmenu-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu-8.dll" v0.0 ts=2006/11/14 23:05
   29k 2003/08/09 C:\cygwin\bin\cygmenu7.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu7.dll" v0.0 ts=2003/8/9 2:25
   67k 2006/11/15 C:\cygwin\bin\cygncurses++-8.dll - os=4.0 img=1.0
sys=4.0
                  "cygncurses++-8.dll" v0.0 ts=2006/11/14 23:13
  237k 2006/11/15 C:\cygwin\bin\cygncurses-8.dll - os=4.0 img=1.0
sys=4.0
                  "cygncurses-8.dll" v0.0 ts=2006/11/14 23:02
  224k 2003/08/09 C:\cygwin\bin\cygncurses7.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses7.dll" v0.0 ts=2003/8/9 2:24
   12k 2006/11/15 C:\cygwin\bin\cygpanel-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel-8.dll" v0.0 ts=2006/11/14 23:04
   19k 2003/08/09 C:\cygwin\bin\cygpanel7.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel7.dll" v0.0 ts=2003/8/9 2:24
  133k 2007/06/27 C:\cygwin\bin\cygpcre-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre-0.dll" v0.0 ts=2007/6/26 20:49
  303k 2007/06/27 C:\cygwin\bin\cygpcrecpp-0.dll - os=4.0 img=1.0
sys=4.0
                  "cygpcrecpp-0.dll" v0.0 ts=2007/6/26 20:50
    7k 2007/06/27 C:\cygwin\bin\cygpcreposix-0.dll - os=4.0 img=1.0
sys=4.0
                  "cygpcreposix-0.dll" v0.0 ts=2007/6/26 20:50
   22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpopt-0.dll" v0.0 ts=2002/6/8 22:45
  154k 2007/08/23 C:\cygwin\bin\cygreadline6.dll - os=4.0 img=1.0
sys=4.0
                  "cygreadline6.dll" v0.0 ts=2007/8/23 15:01
  219k 2007/10/19 C:\cygwin\bin\cygssl-0.9.8.dll - os=4.0 img=1.0
sys=4.0
                  "cygssl-0.9.8.dll" v0.0 ts=2007/10/19 4:45
 1069k 2007/05/22 C:\cygwin\bin\cygxml2-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygxml2-2.dll" v0.0 ts=2007/5/21 23:49
  200k 2007/05/22 C:\cygwin\bin\cygxslt-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygxslt-1.dll" v0.0 ts=2007/5/22 9:08
   65k 2006/10/16 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2006/10/15 18:10
 1830k 2007/01/31 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2007/1/31 1:58
    Cygwin DLL version info:
        DLL version: 1.5.24
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 156
        Shared data: 4
        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
        Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default prefix: 
        Build date: Wed Jan 31 10:57:51 CET 2007
        CVS tag: cr-0x5f1
        Shared id: cygwin1S4


Can't find the cygrunsrv utility, skipping services check.


Cygwin Package Information
Last downloaded files to: C:\Downloads
Last downloaded files from: http://www.gtlib.gatech.edu/pub/cygwin

Package              Version
_update-info-dir     00551-1
alternatives         1.3.29a-1
ash                  20040127-3
base-files           3.7-1
base-passwd          2.2-1
bash                 3.2.25-17
bzip2                1.0.3-2
coreutils            6.9-5
crypt                1.1-1
cygutils             1.3.2-1
cygwin               1.5.24-2
cygwin-doc           1.4-4
editrights           1.01-1
emacs                21.2-13
expat                1.95.8-2
findutils            4.3.8-1
gawk                 3.1.5-4
grep                 2.5.1a-4
groff                1.18.1-2
gzip                 1.3.12-2
less                 382-1
libbz2_1             1.0.3-2
libdb4.2             4.2.52-1
libexpat0            1.95.8-2
libgcrypt            1.2.1-1
libgdbm4             1.8.3-8
libgpg-error         1.1-1
libiconv2            1.11-1
libintl2             0.12.1-3
libintl3             0.14.5-1
libintl8             0.15-1
libncurses7          5.3-4
libncurses8          5.5-3
libpcre0             7.2-1
libpopt0             1.6.4-4
libreadline6         5.2.7-9
libxml2              2.6.28-2
libxml2-python       2.6.26-1
libxslt              1.1.20-2
login                1.9-7
man                  1.6e-1
mktemp               1.5-4
openssl              0.9.8g-1
pylibxml2            2.6.28-2
pylibxslt            1.1.20-2
python               2.5.1-2
python-libxml2       2.6.28-2
python-libxslt       1.1.20-2
rebase               2.4.3-1
run                  1.1.10-1
sed                  4.1.5-2
tar                  1.19-1
tcltk                20060202-1
termcap              20050421-1
terminfo             5.5_20061104-1
texinfo              4.8a-1
wget                 1.10.2-2
which                1.7-1
xemacs-emacs-common  21.4.20-2
zlib                 1.2.3-2
Use -h to see help about each section




----+----
This email message (and any attached document) contains information from Ingenuity Systems Inc. which may be considered confidential by Ingenuity, or which may be privileged or otherwise exempt from disclosure under law, and is for the sole use of the individual or entity to whom it is addressed.  Any other dissemination, distribution or copying of this message is strictly prohibited.  If you receive this message in error, please notify me and destroy the attached message (and all attached documents) immediately. 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]