From owner-freebsd-questions@FreeBSD.ORG Fri May 26 15:28:58 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 3E6C716A431 for ; Fri, 26 May 2006 15:28:58 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC83543D55 for ; Fri, 26 May 2006 15:28:57 +0000 (GMT) (envelope-from wmoran@collaborativefusion.com) Received: from localhost (monrovll-cuda1-24-53-251-44.pittpa.adelphia.net [24.53.251.44]) (AUTH: LOGIN wmoran, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Fri, 26 May 2006 11:29:02 -0400 id 00056405.44771EBE.0000C718 Date: Fri, 26 May 2006 11:28:55 -0400 From: Bill Moran To: Ensel Sharon Message-Id: <20060526112855.32558667.wmoran@collaborativefusion.com> In-Reply-To: References: Organization: Collaborative Fusion X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: remote file moves, over SSH, with wildcards ... help needed. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2006 15:28:58 -0000 Ensel Sharon wrote: > > (FreeBSD 6.0-RELEASE) > > I cannot move a file, over ssh, with wildcards: > > # ssh user@host.com mv /dir/file*.wav /dir2 > ssh: No match. > > Ok, so I quote it: > > # ssh user@host.com mv "/dir/file*.wav" /dir2 > Password: > mv: rename /dir/file*.wav to /dir2/*.wav: No such file or directory > > I even tried single quoting both paths, and just double quoting the > file*.wav > > Nothing works. > > Is it possible to move with wildcards over ssh ? It's definately possible. Others have provided suggestions -- I've had success quoting the entire command: ssh user@host.com "mv /dir/file*.wav /dir2" ssh is odd, because you first have the local shell trying to interpret the metacharacters, then you have the remote shell trying to do it. I've had cases where I had to double escape things, for example: ssh user@host.com "echo \"cp * /backup\" >> log.txt" I wrote a whole remote control framework for a client once, and I believe I had 4 \ at one point in the script. -- Bill Moran That's why I never kiss 'em on the mouth. Jayne Cobb