empty double backquotes unpredictable?
Joel Spolsky
spolsky-joel at CS.YALE.EDU
Fri May 12 12:39:30 AEST 1989
In article <779 at unify.UUCP> rk at unify.UUCP (Ron Kuris) writes:
>When running the csh, I typed only two backquotes (``) and got:
>/s2/acct/rk/bin/: cannot execute
>
csh looks for the command "" (null string). "/s2/acct/rk/bin/" is in
the path and it tries to concatenate "" onto the end of this, getting
"/s2/acct/rk/bin/" ... which exists, so it doesn't have to look
further. But it can't execute it. So it complains. You would get the
same result by just typing any directory name.
>When I removed /s2/acct/rk/bin from my path, the error changes to:
>: cannot execute
It is looking for the command "" (null string) in your current
directory and not finding it.
>What gives? I tried nifty things like: ``file
>which runs /s2/acct/rk/bin/file.
>Then I tried: echo ``
>and got nothing. Seems real bizzare. Any explanations?
Because the command `` doesn't generate any output (it fails to run),
it is inline substituted with nothing so "``file" resolves to "file".
Some naive guesses from...
+----------------+----------------------------------------------------------+
| Joel Spolsky | bitnet: spolsky at yalecs.bitnet uucp: ...!yale!spolsky |
| | internet: spolsky at cs.yale.edu voicenet: 203-436-1483 |
+----------------+----------------------------------------------------------+
#include <disclaimer.h>
More information about the Comp.unix.wizards
mailing list