From owner-freebsd-questions@FreeBSD.ORG Thu May 29 16:26:45 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE69D9BC for ; Thu, 29 May 2014 16:26:45 +0000 (UTC) Received: from www81.your-server.de (www81.your-server.de [213.133.104.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF8C22B92 for ; Thu, 29 May 2014 16:26:44 +0000 (UTC) Received: from [92.76.90.49] (helo=michael-think) by www81.your-server.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1Wq3AA-00036C-7N; Thu, 29 May 2014 18:26:42 +0200 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "FreeBSD Questions" , "Andre Goree" Subject: Re: csh and echo References: <6afd2e37bfc1736513878d896c5c8314@drenet.net> Date: Thu, 29 May 2014 18:26:29 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Michael Ross" Message-ID: In-Reply-To: <6afd2e37bfc1736513878d896c5c8314@drenet.net> User-Agent: Opera Mail/1.0 (Win32) X-Authenticated-Sender: gmx@ross.cx X-Virus-Scanned: Clear (ClamAV 0.98.1/19046/Thu May 29 15:38:02 2014) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:26:46 -0000 On Thu, 29 May 2014 18:02:35 +0200, Andre Goree wrote: > I'm writing a script within which I need to have encrypted passwords > passed to 'pw mod user'. My issue is that csh does not seem to escape > the the "$" correctly and thus I receive an "Undefined variable" error > message. Bash does not seem to have this same issue: > > root@fbsdtest13:~ # echo "$1$rVxldcGZ$CisrIAX4SBYUkMJt9KjXl0" > rVxldcGZ: Undefined variable. > root@fbsdtest13:~ # bash > [root@fbsdtest13 ~]# echo "$1$rVxldcGZ$CisrIAX4SBYUkMJt9KjXl0" > > [root@fbsdtest13 ~]# echo "\$1\$rVxldcGZ\$CisrIAX4SBYUkMJt9KjXl0" > $1$rVxldcGZ$CisrIAX4SBYUkMJt9KjXl0 > [root@fbsdtest13 ~]# exit > root@fbsdtest13:~ # echo "\$1\$rVxldcGZ\$CisrIAX4SBYUkMJt9KjXl0" > rVxldcGZ: Undefined variable. > > Any insight would be greatly appreciated! :) > Try with single quotes: # echo '$1$rVxldcGZ$CisrIAX4SBYUkMJt9KjXl0' $1$rVxldcGZ$CisrIAX4SBYUkMJt9KjXl0 ( Sorry for the damaged 2nd mail, in case it got through ) Michael