From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4D84C59CAF for ; Fri, 8 Apr 2016 13:05:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A8FB221C091; Fri, 8 Apr 2016 13:05:50 +0000 (UTC) Received: from sunflo-mx.v.h.gc-24.de (gc-24.de [46.227.95.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7F05121C007 for ; Fri, 8 Apr 2016 13:05:49 +0000 (UTC) Received: from hw.v.h.gc-24.de ([192.168.220.17]) by sunflo-mx.v.h.gc-24.de with esmtp (Exim 4.84) (envelope-from ) id 1aoW6d-0000ka-EE for gentoo-user@lists.gentoo.org; Fri, 08 Apr 2016 15:05:47 +0200 Subject: Re: [gentoo-user] lftp -u user,pass(word To: gentoo-user@lists.gentoo.org References: <5703B2ED.5070009@gc-24.de> <20160405135236.41ee6626@digimed.co.uk> <5703FE90.5010404@gc-24.de> <2060950.47PH9WsnKc@dell_xps> <5704C570.2090607@gc-24.de> <20160406095857.65c11502@digimed.co.uk> From: hw Message-ID: <5707ACA9.5040002@gc-24.de> Date: Fri, 8 Apr 2016 15:05:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <20160406095857.65c11502@digimed.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: ca34e9d2-bc34-4ceb-baf6-060a2f133aa1 X-Archives-Hash: bb9d390b975d286bde673cc0a6f985a6 Neil Bothwick schrieb: > On Wed, 6 Apr 2016 10:14:40 +0200, hw wrote: > >> Mick schrieb: >>> On Tuesday 05 Apr 2016 20:06:08 hw wrote: >>>> Neil Bothwick schrieb: >>>>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote: >>>>>> how do you use lftp (to mirror a remote site) >>>>>> when the password you have contains a bracket? >>>>>> >>>>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and >>>>>> there appears to be no way to escape characters in the >>>>>> password. Using single quotes also doesn't work, same >>>>>> as 'lftp 'ftp://user:pass(word@example.com'. >>>>> >>>>> Try lftp 'ftp://user:pass\(word@example.com' >>>>> or lftp ftp://user:pass\\\(word@example.com >>>>> >>>>> The \ escapes the ( and the single quotes protect it fro the shell. >>>>> In the second way, you escape the \ as well. >>>> >>>> That's what I thought :) I already tried and it didn't >>>> work. >>> >>> Did you try putting single/double quotes around passwd only? >>> >> >> Yes, that didn't work, either. > > I had a quick look at the man page and it says that parentheses can be > used to group commands, so maybe lftp is misinterpreting the ( in this > way. > > However, the man page also advises against giving the password on the > command line (because it is then available to anyone with normal user > shell access while the command is running) and suggests using either I need to use it with a script for automatic downloads, so the password wouldn't appear in the history. Using a ~/.netrc would create a dependency on the user who runs the script, which is something I would prefer to avoid. > ~/.netrc, which you have already said works, or $LFTP_PASSWORD along > with --env-password. Have you tried this? > > LFTP_PASSWORD='pass(word' lftp --env-password -u user ftp://example.com Thanks, that looks like a good solution. I'll see if that works ...