You are not logged in.

#1 2009-08-15 17:31:58

falomir
Member
Registered: 2009-02-15
Posts: 15

[SOLVED]zsh and variables?

hello,

is there possibility to export global(local) variables with spaces between names?
now my shell only export first part of variable, to space

regards

Last edited by falomir (2009-08-18 04:33:00)

Offline

#2 2009-08-15 18:01:47

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED]zsh and variables?

export FOO="lol this has spaces" ?


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2009-08-15 20:10:57

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: [SOLVED]zsh and variables?

Hello Falomir!

Or: export FOO=hello\ world

Offline

#4 2009-08-17 07:45:02

falomir
Member
Registered: 2009-02-15
Posts: 15

Re: [SOLVED]zsh and variables?

Mr.Elendig

ALBUM=$(cat /home/qaov/cnk | grep Album | cut -c 8-)

that`s my variable, inside sh script

adding "" won`t help...
maybe i must replace spaces with special variable like these from djszapi`s post ?

' '  =>  '\ '

Last edited by falomir (2009-08-17 07:47:46)

Offline

#5 2009-08-17 10:44:10

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: [SOLVED]zsh and variables?

Try

ALBUM="$(cat /home/qaov/cnk | grep Album | cut -c 8-)"

The whole expression was quoted
.]

Last edited by alterecco (2009-08-17 10:44:44)

Offline

#6 2009-08-17 11:26:05

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED]zsh and variables?

--> zsh
--> export test=$(echo one two three)
--> echo $test
one
--> export test="$(echo one two three)"
--> echo $test
one two three
--> bash
--> export test=$(echo one two three)
--> echo $test
one two three
--> exit

A bug maybe?

var=$(..) should work without quotes

--> test=$(echo one two three)
--> export test                        
--> echo $test
one two three

Offline

#7 2009-08-17 11:35:24

falomir
Member
Registered: 2009-02-15
Posts: 15

Re: [SOLVED]zsh and variables?

maybe a bug...
that would do the job, i`ll test it at home
thanks for advice smile

Offline

#8 2009-08-17 12:23:09

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: [SOLVED]zsh and variables?

Unrelated, but there's a useless cat in there:

 cat /home/qaov/cnk | grep Album

is the same as

grep Album /home/qaov/cnk

Edit: spelling

Last edited by Trent (2009-08-17 12:23:51)

Offline

#9 2009-08-17 13:31:27

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: [SOLVED]zsh and variables?

It isn't necessarily a bug. Some zsh options change how it handles quotes, variables, etc.


(lambda ())

Offline

#10 2009-08-18 04:32:16

falomir
Member
Registered: 2009-02-15
Posts: 15

Re: [SOLVED]zsh and variables?

--> export test="$(echo one two three)"

that works fine Procyon smile

and i also put Trent advice in use smile
now i can go further smile

Offline

Board footer

Powered by FluxBB