From owner-freebsd-questions@FreeBSD.ORG Tue Dec 23 18:13:43 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79C1516A4CE for ; Tue, 23 Dec 2003 18:13:43 -0800 (PST) Received: from straycat.dhs.org (h0050da134090.ne.client2.attbi.com [65.96.131.3]) by mx1.FreeBSD.org (Postfix) with SMTP id A3CA743D49 for ; Tue, 23 Dec 2003 18:13:41 -0800 (PST) (envelope-from tmclaugh@sdf.lonestar.org) Received: (qmail 31073 invoked from network); 24 Dec 2003 02:14:16 -0000 Received: from unknown (HELO ?192.168.1.128?) (192.168.1.128) by 192.168.1.129 with SMTP; 24 Dec 2003 02:14:16 -0000 From: Tom McLaughlin To: FreeBSD Questions Content-Type: text/plain Message-Id: <1072232103.93831.19.camel@compass> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 23 Dec 2003 21:15:04 -0500 Content-Transfer-Encoding: 7bit Subject: minor `cp -R` question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2003 02:13:43 -0000 Hi, I have a quick question about the cp command and recursively copying a directory. If I type: $ cp -R /foo/file/ ~/ I get in my home directory a file called "file". If I type: $ cp -R /foo/file ~/ I get in my home directory a directory called "foo" and a file called "file". Can someone explain why the trailing slash cp to behave differently? My user shell is pdksh and the root shell is csh. I have pdksh set to use "complete-list" and csh to use "autolist". Is this behavior just something unique to FreeBSD? I tried the same on my OpenBSD box and the two commands worked the same and created a directory with a file in it. I also don't remember these working differently on linux. Do I possibly have something setup wrong with my shells? Thanks.