Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2001 00:43:07 -0500
From:      "G. Adam Stanislav" <adam@whizkidtech.net>
To:        newbies@freebsd.org
Subject:   Darn DOS habits
Message-ID:  <20010621004307.A295@whizkidtech.net>

next in thread | raw e-mail | index | archive | help
You might think that after tinkering with FreeBSD for some three
years, I would not make certain stupid mistakes. Alas, old habits
are hard to break. Especially when those habits come from using
the DOS shell (I tossed COMMAND.COM for the Unix-like 4DOS many
years ago), and when you are still using that shell under the other
OS.

Anyway, I did one of those stupid old-habits-die-hard mistakes
today. I thought I'd share it with other newbies in the hope of
stopping someone else from making the same mistake.

I spent several hours (or at least it seemed that way) creating
two EPS (Encapsulated PostScript) files containing some
flowcharts. One was serv.eps, the other serv2.eps. I created
them under the other OS because I wanted to see their output.
(I created them by writing the PostScript code directly, not
by using an image editor.)

When done, I rebooted to FreeBSD, switched to the directory that
was the final destination for these two files, and typed:

	cp /d/path/serv*.eps

Now, what I *meant* to type was:

	cp /d/path/serv*.eps .

That is, copy these two files to this directory. I forget that
last dot a lot because under 4DOS the dot is implied: Its copy
command always copies to the current directory unless you expressly
tell it otherwise.

Normally, I discover my mistake quite quickly as FreeBSD complains
that I did not use the cp command correctly. This time, however,
it did not complain. I realized my mistake anyway, and was wondering
why it did not complain. When I figured the answer out, I was not happy.

It was a mistake I should not have made because by now I know
quite well that whenever we enter wildcards at the shell prompt,
it is the shell that expands the wildcards. Indeed, the shell
expanded /d/path/serv*.eps into:

	/d/path/serv.eps /d/path/serv2.eps

In other words, when I entered

	cp /d/path/serv*.eps

the shell changed it to:

	cp /d/path/serv.eps /d/path/serv2/eps

That, unfortunately, is a perfectly legitimate way of using the
cp command. It did not complain because what I really told it
was to overwrite the contents of /d/path/serv2.eps with those
of /d/path/serv.eps, and it did what I asked.

And, of course, I had no backup (this was supposed to *be* the
backup). Luckily, I had it still fresh in my mind, and was able
to recreate serv2.eps in some 20 minutes or so (which, compared
to hours, is not so bad).

This has been a valuable lesson for me, and now I hope for at
least some of you as well.

Cheers,
Adam
-- 
A billion dollars in the bank,
without the experience of carefreeness and charity,
is a state of poverty.
		-- Deepak Chopra

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-newbies" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010621004307.A295>