I want to write a file using echo command. The echo commend will get data from anther file.
Here is the echo command:
echo '{
name: $name
id: $seq
}
I have a txt file:
customer 1
customer 2
customer 3
So I want to generate a file doing echo and replace $name from fist line from the txt file.
And then replace $seq start with 1.
This is the file i want.
{
name: customer 1
id: 1
}
{
name: customer 2
id: 2
}
{
name: customer 3
id: 3
}
While reading first line, the ID should be 1, while reading second line the ID should be 2`
$name
and$seq
come from? Your currentecho
approach is not optimal