[EMAIL PROTECTED] wrote:
I'm new to bash and am trying to write a script that puts 3 substrings in 3
variables.  I have a string with password,firstname,lastname. and I need it to
be in 3 variables.

I'm just an apprentice here, but I think "cut" is a good choice of tool.

$ echo 'password,firstname,lastname' | cut -d',' -f1
password
$ echo 'password,firstname,lastname' | cut -d',' -f2
firstname
$ echo 'password,firstname,lastname' | cut -d',' -f3
lastname

-d is the field delimiter, -f says which fields you want

John

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to