Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 May 2007 21:12:33 -0700
From:      Bill Campbell <freebsd@celestial.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Spaces in SSID in /etc/rc.conf
Message-ID:  <20070515041233.GA9521@ayn.mi.celestial.com>
In-Reply-To: <04E232FDCD9FBE43857F7066CAD3C0F12DF4B1@svmailmel.bytecraft.internal>
References:  <04E232FDCD9FBE43857F7066CAD3C0F12DF4B1@svmailmel.bytecraft.internal>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20070515041233.GA9521>