From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: IFS, set, and positional parameters not doing what I expect
Date: Mon, 29 Mar 2004 00:53:06 +0000 [thread overview]
Message-ID: <1040329005306.ZM26497@candle.brasslantern.com> (raw)
In-Reply-To: <20040328220419.21291.qmail@webmail-2-6.mesa1.secureserver.net>
On Mar 28, 3:04pm, jason@jnj.org wrote:
}
} f="a:b:c"
} OFS=$IFS; IFS=: ; set -- $f ; IFS=$OFS
}
} which sets $1=a, $2=b, $3=c.
This requires either
set -- ${=f}
Or that you have `setopt sh_word_split'.
} In zsh, this sets $1=a:b:c. I've tried mucking around with
} the word splitting options to no avail.
Works For Me (tm):
schaefer<501> setopt shwordsplit
schaefer<502> f="a:b:c"
schaefer<503> OFS=$IFS; IFS=: ; set -- $f ; IFS=$OFS
schaefer<504> echo $1
a
schaefer<505> echo $2
b
schaefer<506> echo $3
c
next prev parent reply other threads:[~2004-03-29 0:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-28 22:04 jason
2004-03-29 0:53 ` Bart Schaefer [this message]
2004-03-29 1:29 jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1040329005306.ZM26497@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).