Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Splitting $foo on delimiter value
- X-seq: zsh-users 3005
- From: "Allen Belk" <allen.belk@xxxxxxx>
- To: <zsh-users@xxxxxxxxxxxxxx>
- Subject: Splitting $foo on delimiter value
- Date: Mon, 3 Apr 2000 09:28:47 -0500
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- Organization: University of Southern Mississippi
Zsh-users,
I am looking for the appropriate method of splitting a string at a set
delimiter.
foo=red:white:blue
I want to seperate these into 3 fields much the way the unix cut command
would as in:
$ echo $foo | cut -d : -f 1
red
$ echo $foo | cut -d : -f 2
white
$ echo $foo | cut -d : -f 3
blue
I want to exploit zsh's internal features without having to use external
commands. Any suggestions will be greatly appreciated.
Thanks,
Allen Belk
| Allen Belk, Systems Manager
| Office of Technology Resources
| University of Southern Mississippi
| allen.belk@xxxxxxx 601.266.6013
Messages sorted by:
Reverse Date,
Date,
Thread,
Author