I have a text file called branch.txt and it has list of users as line belowbranch.txt:
cat branch.txt
DEMAND_NAME-CR-1234
DEMAND_NAME-CR-8970
$ cat branch.txt
DEMAND_NAME-CR-1234
DEMAND_NAME-CR-8970
Using the above branch name i, I have to find and replace some valuevalues using seda sed command:
branch_name=`(cat /tmp/branch.txt)`
sed -i "s/deploy_branch/$branch_name/g" /tmp/input.file
branch_name=`(cat /tmp/branch.txt)`
sed -i "s/deploy_branch/$branch_name/g" /tmp/input.file
When i running sedI run the sed command i'm gettting, I get an error like the one below.:
cat /tmp/input.file
<Project description="first-deployment" name="deploy_branch" overwrite="true" type="Repository">
</Project>
sed: -e expression #1, char 35: unterminated `s' command
sed: -e expression #1, char 35: unterminated `s' command
Expected output:
<Project description="first-deployment" name="DEMAND_NAME-CR-1234 DEMAND_NAME-CR-8970 " overwrite="true" type="Repository">
</Project>
<Project description="first-deployment" name="DEMAND_NAME-CR-1234 DEMAND_NAME-CR-8970 " overwrite="true" type="Repository">
</Project>
Input file:
<Project description="first-deployment" name="deploy_branch" overwrite="true" type="Repository">
</Project>