1

I'd like to put two strings in two different variables. Let's take a small example.

after a simple grep, I got this :

$ grep nl.*acc.*bas :
ABAS01=...
ABAS02=...

I'd like to have two variables, one containing ABAS01, and the other containing ABAS02.

How can I do this ? I guess a loop can be used to go through all the results from my query, then I could do a cut -d= -f1 to retrieve the name of the variables.

How can I do this ?

2

If it's AT&T or zsh implementations of ksh:

cmd | { IFS== read -r var1 x && IFS== read -r var2 x; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.