From owner-freebsd-questions@FreeBSD.ORG Tue May 15 04:10:43 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7900F16A403 for ; Tue, 15 May 2007 04:10:43 +0000 (UTC) (envelope-from bill@ayn.mi.celestial.com) Received: from ayn.mi.celestial.com (hayek.celestial.com [192.136.111.12]) by mx1.freebsd.org (Postfix) with ESMTP id 42B4D13C459 for ; Tue, 15 May 2007 04:10:42 +0000 (UTC) (envelope-from bill@ayn.mi.celestial.com) Received: from localhost (localhost [127.0.0.1]) by ayn.mi.celestial.com (Postfix) with ESMTP id 25B1268621E7C; Mon, 14 May 2007 21:12:34 -0700 (PDT) X-Virus-Scanned: amavisd-new at mi.celestial.com Received: from ayn.mi.celestial.com ([127.0.0.1]) by localhost (ayn.mi.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dB3HREZnSDyY; Mon, 14 May 2007 21:12:34 -0700 (PDT) Received: by ayn.mi.celestial.com (Postfix, from userid 203) id 004B5682E06A8; Mon, 14 May 2007 21:12:33 -0700 (PDT) Date: Mon, 14 May 2007 21:12:33 -0700 From: Bill Campbell To: freebsd-questions@freebsd.org Message-ID: <20070515041233.GA9521@ayn.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <04E232FDCD9FBE43857F7066CAD3C0F12DF4B1@svmailmel.bytecraft.internal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04E232FDCD9FBE43857F7066CAD3C0F12DF4B1@svmailmel.bytecraft.internal> User-Agent: Mutt/1.5.11 OpenPKG/2.5 Subject: Re: Spaces in SSID in /etc/rc.conf X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2007 04:10:43 -0000 On Tue, May 15, 2007, Murray Taylor wrote: > >> -----Original Message----- >> From: owner-freebsd-questions@freebsd.org >> [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of >> Gunther Mayer >> Sent: Tuesday, 15 May 2007 5:46 AM >> To: freebsd-questions@freebsd.org >> Subject: Spaces in SSID in /etc/rc.conf >> >> Hi there, >> >> I got a low key server who is wirelessly connected to the net >> using an >> SSID that contains a space. In rc.conf I define the ifconfig line for >> configuration of my wireless interface upon bootup, but the >> entire line >> reads something like >> >> ifconfig_ath0=' inet 192.168.0.1 ssid "my network" ' >> >> No matter how I tweak the quotes (single then double, other >> way round, >> with lots of \\) I never get my interface to configure properly upon >> bootup and I need to get to the console to fix it up. I >> thought I knew >> shell syntax but this is beyond me or manpages... >> >> What's the right way to do this? >> >> Gunther > >Have you tried this (I havent, its just a suggestion)... > >I use this construct to get around scp transfers and the >file names windoze users love to create with heaps of spaces... I would look at the code that uses this as often this type of problems results from multiple expansions of an expression. In this case the variable ifconfig_ath0 is set to ``inet 192.168.0.1 ssid "my network"'', but that may well be used in an `eval` or some such resulting in multple expansions. Backwhacking the double quotes might help: ifconfig_ath0='inet 192.168.0.1 ssid \"my network\"' One could always cheat and create a simple script to execute instead of trying to fight the quoting wars. ifconfig_ath0='/usr/local/bin/mynetwork.sh' Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 ``Never do your enemy a minor injury.'' - Machiavelli