dotequals
Posts: 4
Joined: May 10, '06,
Status: offline
|
Let's say I want to know what kind of file my cat executable is. I can run file on it, but first I need to know where it is, so I run which on it:
$ which cat
C:\usr\bin\WSFU\bin\cat
Which is fine, except it's a Windows path, and I want to pass it to file, which takes a unix path; so I run winpath2unix on it:
$ winpath2unix $(which cat)
/dev/fs/C/usr/bin/WSFU/bin/cat
Also still fine. But now I try to pass that to file:
$ file $(winpath2unix $(which cat))
' (No such file or directory).n/WSFU/bin/cat
Not fine! Actually, that's really weird. But if I just echo that same subshell command:
$ echo $(winpath2unix $(which cat))
/dev/fs/C/usr/bin/WSFU/bin/cat
it works perfectly. Furthermore, if I pass the path to file manually:
$ file /dev/fs/C/usr/bin/WSFU/bin/cat
/dev/fs/C/usr/bin/WSFU/bin/cat: Windows NT PE format (EXE), executable not stripped Intel Posix-CUI DOS executable (EXE)
nothing is wrong there either. I can't figure this out, but it seems to have broader implications than just file.
Max
|