#!/bin/bash
v="test"
result=`grep 'Dir=' /home/xtend/Videos/file.ini | cut -d'=' -f 2`;
foo="$result"
foo+="$v"
echo $foo

answer expecting(/home/file/test)
answer getting(teste/file)

(In "/home/xtend/Videos/file.ini" "Dir=/home/file/") ...

how it is outputing like this?

Be sure to try each command at the bash prompt to see how it works.

Also, try the older string concatention method. Example:
foo="$result $v"
Or forget v and foo then write:
foo="$result test"

commented: (I have tried it using awk also but the result is same)result=`awk '$0 ~ /Dir=/{print}' $xv | cut -d'=' -f 2`; +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.