HP3000-L Archives

September 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Tue, 26 Sep 2000 17:42:05 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
[log in to unmask] wrote:
>
> My Salaam to all,
>
> The possible combinations of values for a particular variable TEMPVAR could
> be as follows:
>
> 1. TEMPVAR = "[log in to unmask]"
...snip...
>
> How do I break this up into 3 different variable TEMPVAR1, TEMPVAR2,
> TEMPVAR3 such that the results should be as follows:
>
> 1. TEMPVAR1 = "AI@J", TEMPVAR2 = "GROUP1", TEMPVAR3 = "ACCOUNT1"
...snip...

A POSIX shell solution:

nomad:/BIXBY/PUB/demo$ cat ./split
#!/bin/sh

TEMPVAR="[log in to unmask]"

OLDIFS="$IFS"
IFS=.
set -- $TEMPVAR
IFS="$OLDIFS"

echo "file=$1"
echo "group=$2"
echo "account=$3"

nomad:/BIXBY/PUB/demo$ ./split
file=AI@J
group=GROUP1
account=ACCOUNT1

- Mark B.

ATOM RSS1 RSS2