Re: The colon

2009-01-26 Thread Stephane Chazelas
On Mon, Jan 26, 2009 at 07:13:32AM +0100, Jan Schampera wrote: > Hi. > > In comp.unix.shell [1] somebody wondered about > IFS=: read a b <<< a:b; echo "'$a' '$b'" > ending up in > 'a b' '' > > Korn and Z seem to behave different. I see that across all my available > Bash versions. I remember

Re: test fields in bash

2009-01-26 Thread Bob Proulx
BooBz wrote: > I have a file : > fghfgh 45 45 100 > hjuhju 90 45 90 > and i want to test the field to rewrite or not another field : > if field2 = 45 and field3 = 45 then field4 = field4 - 10 > if field2 = 45 and field3 = 90 then field4 = field4 - 5 > if field2 = 90 and field3 = 45 then field4 =

The colon

2009-01-26 Thread Jan Schampera
Hi. In comp.unix.shell [1] somebody wondered about IFS=: read a b <<< a:b; echo "'$a' '$b'" ending up in 'a b' '' Korn and Z seem to behave different. I see that across all my available Bash versions. I remember the colon to be special in some way (was it hostnames in a file path?), but I don

test fields in bash

2009-01-26 Thread BooBz
Hi, i have a problem on my last step ... I have a file : fghfgh 45 45 100 hjuhju 90 45 90 and i want to test the field to rewrite or not another field : if field2 = 45 and field3 = 45 then field4 = field4 - 10 if field2 = 45 and field3 = 90 then field4 = field4 - 5 if field2 = 90 and field3 = 4