9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] rc strings
@ 2010-03-11 11:43 hugo rivera
  2010-03-11 11:46 ` Francisco J Ballesteros
  2010-03-11 11:53 ` roger peppe
  0 siblings, 2 replies; 5+ messages in thread
From: hugo rivera @ 2010-03-11 11:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi,

% n=`{echo 'a           b'}

sets n to a list containing two elements, 'a' and 'b'. How can I set n
to a single string 'a           b'? note that I must execute external
commands, so the obvious solution

% n='a           b'

doesn't work for me.
Saludos,

--
Hugo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc strings
  2010-03-11 11:43 [9fans] rc strings hugo rivera
@ 2010-03-11 11:46 ` Francisco J Ballesteros
  2010-03-11 11:52   ` hugo rivera
  2010-03-11 11:53 ` roger peppe
  1 sibling, 1 reply; 5+ messages in thread
From: Francisco J Ballesteros @ 2010-03-11 11:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

cant you just use $"n ?


On Thu, Mar 11, 2010 at 12:43 PM, hugo rivera <uair00@gmail.com> wrote:
> Hi,
>
> % n=`{echo 'a           b'}
>
> sets n to a list containing two elements, 'a' and 'b'. How can I set n
> to a single string 'a           b'? note that I must execute external
> commands, so the obvious solution
>
> % n='a           b'
>
> doesn't work for me.
> Saludos,
>
> --
> Hugo
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc strings
  2010-03-11 11:46 ` Francisco J Ballesteros
@ 2010-03-11 11:52   ` hugo rivera
  0 siblings, 0 replies; 5+ messages in thread
From: hugo rivera @ 2010-03-11 11:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> cant you just use $"n ?

No, because the number of spaces in between is important. But I found a solution

% ifs='
    ' n=`{echo 'a           b'}

works fine. Sorry for the noise.


--
Hugo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc strings
  2010-03-11 11:43 [9fans] rc strings hugo rivera
  2010-03-11 11:46 ` Francisco J Ballesteros
@ 2010-03-11 11:53 ` roger peppe
  2010-03-11 12:00   ` hugo rivera
  1 sibling, 1 reply; 5+ messages in thread
From: roger peppe @ 2010-03-11 11:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

what about this?
ifs='
' n=`{echo 'a    b'}

or

ifs='' n=`{echo 'a    b'}

if you don't mind the newline character being in the string.

On 11 March 2010 11:43, hugo rivera <uair00@gmail.com> wrote:
> Hi,
>
> % n=`{echo 'a           b'}
>
> sets n to a list containing two elements, 'a' and 'b'. How can I set n
> to a single string 'a           b'? note that I must execute external
> commands, so the obvious solution
>
> % n='a           b'
>
> doesn't work for me.
> Saludos,
>
> --
> Hugo
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] rc strings
  2010-03-11 11:53 ` roger peppe
@ 2010-03-11 12:00   ` hugo rivera
  0 siblings, 0 replies; 5+ messages in thread
From: hugo rivera @ 2010-03-11 12:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Yes, works just as I needed.
Thanks.

2010/3/11 roger peppe <rogpeppe@gmail.com>:
> what about this?
> ifs='
> ' n=`{echo 'a    b'}
>
> or
>
> ifs='' n=`{echo 'a    b'}
>
> if you don't mind the newline character being in the string.
>

-- 
Hugo



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-11 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-11 11:43 [9fans] rc strings hugo rivera
2010-03-11 11:46 ` Francisco J Ballesteros
2010-03-11 11:52   ` hugo rivera
2010-03-11 11:53 ` roger peppe
2010-03-11 12:00   ` hugo rivera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).