Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2001 09:20:19 +0200
From:      =?iso-8859-1?q?J=F6rgen=20Sigvardsson?= <jorgen.sigvardsson@kau.se>
To:        newbies@FreeBSD.ORG
Cc:        "G. Adam Stanislav" <adam@whizkidtech.net>
Subject:   Re: Darn DOS habits
Message-ID:  <01062109201901.00400@js-pc.cs.kau.se>
In-Reply-To: <20010621004307.A295@whizkidtech.net>
References:  <20010621004307.A295@whizkidtech.net>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 21 June 2001 07:43, you wrote:
[SNIP]
> 	cp /d/path/serv*.eps
>
> Now, what I *meant* to type was:
>
> 	cp /d/path/serv*.eps .
>
Been there, done that, not doing it again. ;)
It takes a while to grasp (if you have any DOS habits) that the shell is 
doing the wild card expansion and not the programs themselves.

If you are paranoid you can always use -i with cp. cp will then require  
confirmation when overwriting files.
Example:
$ cp -i /d/path/serv*.eps
overwrite /d/path/serv2.eps? (y/n [n]) n
not overwritten
$

As root I have an alias cp = 'cp -i' which forces me to confirm all the time, 
unless I override it with -f.
Example:
alias cp 'cp -i'
$ cp /d/path/serv*.eps
overwrite /d/path/serv2.eps? (y/n [n]) n
not overwritten
$ cp -f /d/path/serv*.eps
$

Quite nice since it requires you to take the initiative to do something 
stupid ;)

You can also do this with `mv' and `rm'.

You might be frustrated at times when you are copying a bunch of files, but 
you'll thank `-i' later when you detect that you are about to do something 
really bad. 

- -- 
Jörgen Sigvardsson, B. Sc.
Lecturer, Computer Science Dept. Karlstad University
Tel: +46-(0)54-700 1786
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE7MaAzJtcD8rikkmwRAqttAKCYoYfcgyV84Cywb9Tx8E1leB2CUwCfUaTa
MNL1uUGswignaD0qA2WrjeQ=
=k1Kg
-----END PGP SIGNATURE-----

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?01062109201901.00400>