Currently Being ModeratedMar 18, 2012 4:10 PM (in response to grnfrog55)
It is the $ that is causing problems. Protect that $
-OR- use a wildcard
If you are going to be messing about using Terminal, you could always just use the mount command and specify your own mount point for each unique volume and avoid the C$ madness.
Currently Being ModeratedMar 18, 2012 5:06 PM (in response to BobHarris)
Before posting my suggestion of cd C$\-1, I had tested it on a folder and it seemed to work there. Could you please explain why?
For the test, I created folders named C$ and C$-1 in an empty USB flash drive, and then listed them:
2010-Computer:~ t$ cd /Volumes/USB2
2010-Computer:USB2 t$ ls
I then tried to cd directly into C$, and that worked OK:
2010-Computer:USB2 t$ cd C$
After going back to the USB drive directory, I got the same error as the OP when I tried to cd into C$-1 directly:
2010-Computer:C$ t$ cd /Volumes/USB2
2010-Computer:USB2 t$ cd C$-1
-bash: cd: ChimBH1: No such file or directory
But I could cd into C$-1 by escaping the hyphen rather than the dollar:
2010-Computer:USB2 t$ cd C$\-1
Why did this work?
Why did cd C$ successfully enter the first folder - the $ was not escaped there.
And where did "ChimBH1" come from in the error message above?
Currently Being ModeratedMar 18, 2012 5:39 PM (in response to jsd2)
At the shell level, there is nothing magical about - (dash).
But $ is the shells variable substitution operator. Using single quotes around string with the $ or a backslash before the $ will disable the magical properties of the $
I can only assume that if $ is not followed by a valid variable name it is ignored, but $- is a valid substitution, so $\- would no longer have a valid variable name following $. And of course C$ has nothing following it, so again the $ is ignored.
I cannot find any explicitly stated in the 'man bash' page, but a lot of things are not stated in the bash man page. And I know that not all shells will honor the C$\-1 syntax, so 'C$-1' or C\$-1 is a safer approach to $ protection when it is in a file name.
The himBH came from
and C...1 where before and after $-