Hi,
i have a file as give below
>cat sample_file
param1 val1 2012-06-19
##there can be one or more space after 2012-06-19 in the above file
i want to replace val1 with a with value passed through a variable...
below is the command i tried
>parval='param1 val2'
>par1=param1
>sed "s/$par1 ..* /$parval /g" < sample_file
param1 val2
ie, the whole line in the sample file is replaced (the date is removed) but i want only the param1 val1 to be replaced with the parval variable value
can anyone help me with a suitable sed command for this requirement