How to remove double first quote from the line in shell script

  Kiến thức lập trình

Line1 : "TF_TOKEN"="test2"

Line2: "TF_TEST_TOKEN"="test3"

Expected output:  

1: TF_TOKEN="test2"

2: TF_TEST_TOKEN="test3"

Thanks

How to remove the double first quote from the line

2

If you really just want to remove the first two instances of ", you can remove the first instance twice:

$ cat input
Line1 : "TF_TOKEN"="test2"
Line2: "TF_TEST_TOKEN"="test3"
$ sed -e 's/"//1' -e 's/"//1' input
Line1 : TF_TOKEN="test2"
Line2: TF_TEST_TOKEN="test3"

But more likely you are looking for something like:

sed -e 's/"([^="]*)"/1/' 

1

LEAVE A COMMENT