zsh-users
 help / color / mirror / code / Atom feed
* parameter expansion question
@ 2003-01-18 23:32 Le Wang
  2003-01-19  6:33 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Le Wang @ 2003-01-18 23:32 UTC (permalink / raw)
  To: Zsh users list

Hi,

I can force a variable to be expanded by using
${~var}.  Is there any way I can force a string to be
expanded without assigning it to a variable first?

I'm after the same information for filename
generation.  For exampel:

Right now, if I want to see if the glob pattern
'(#i)${i%.rar}*.par' would match anything, I would do:

  parFile=`print (#i)${i%.rar}*.par`

if I use: 


  parFile=(#i)${i%.rar}*.par

Zsh thinks I want an array.

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


^ permalink raw reply	[flat|nested] 5+ messages in thread
* parameter expansion question
@ 2004-01-18  0:28 Szekeres István
  2004-01-18  1:54 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Szekeres István @ 2004-01-18  0:28 UTC (permalink / raw)
  To: Zsh list

Hello,

I have a problem with parameter expansion, could you please take a look
at it?

I try to do the following:

print_em ()
{
	echo 1=$1 2=$2 3=$3
}

#this is ok, it prints 1=a 2= 3=b
print_em "a" "" "b"

#this is NOT ok, it prints 1=a 2=b 3=
foo='a::b'
print_em ${(s/:/)foo}

It seems like in the second case the empty string is not passed as the
2nd parameter. How to specify the expansion so it will pass the empty
string just like in the first example?

Thanks in advance,
Istvan







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

end of thread, other threads:[~2004-01-18  1:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-18 23:32 parameter expansion question Le Wang
2003-01-19  6:33 ` Bart Schaefer
2003-01-19 22:33   ` Le Wang
2004-01-18  0:28 Szekeres István
2004-01-18  1:54 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).