[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



> isn't that the same thing as cd /?
>
> at least that's what I see.
>
> Jason
>
>
> On Mar 15, 2004, at 5:13 PM, Michael D. Hirsch wrote:
>
> > Quick!  What is the effect of "cd //"?  I sure guessed wrong.
> >
> > I don't really understand what is happening when I do that on RH under
> > bash.
> > Can anyone explain this?


this:
$ cd /
and this:
$ cd //

should both take you to the root directory. This is because POSIX mandates
that multiple slashes in a row must be equivilant to a single slash. This
is handy in cases like this:

psedocode:

path1 = "/path/1"
path2 = "/path/2/"
randompath = pickAPathAtRandom( path1, path2 )
afile = "file.name"

fullpath = randompath + "/" + afile

I think there is a limit to the number of consecutive /'s that POSIX
requires resolving to a single /.

	bjorn


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00529" href="msg00529.html">[ale] Quick LInux Quiz</a></strong>
<ul><li><em>From:</em> mhirsch at nubridges.com (Michael D. Hirsch)</li></ul></li>
<li><strong><a name="00530" href="msg00530.html">[ale] Quick LInux Quiz</a></strong>
<ul><li><em>From:</em> vinson.lists at charter.net (Jason Vinson)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00533.html">[ale] GPL Question.</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00535.html">[ale] &quot;What's So Bad About Microsoft?&quot;</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00580.html">//hostname/ shares (Was: Re: [ale] Quick LInux Quiz)</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00532.html">[ale] Quick LInux Quiz</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00534"><strong>Date</strong></a></li>
<li><a href="threads.html#00534"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>