Search Results

Search: Posts Made By: sabbata
21,155
Posted By sabbata
Thanks
Thanks to both for the quick reply.

Newline in the input wasn't an option with my real life data, but Michael Stora's suggestion solved my problem.
21,155
Posted By sabbata
[Solved] Reading multiple values in while loop
I'm having trouble with a simple piece of code.

IFS=,
echo "1,2,3,4,5,6,7,8" | while read x y
do
echo "x=$x"
echo "y=$y"
done

I'm hoping for
x=1
y=2
x=3
y=4
.
.
.

but I'm...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 09:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy