I ned to replace the substring from shell script. Using bellow link i have try but no luck.
Replace one substring for another string in shell script
I have try:
variableString=$(find . -type f -name 'test.*.nupkg')
oldstr="./"
newstr=""
result=$(echo $variableString | sed "s/$oldstr/$newstr/g")
echo "Original String : $variableString"
echo "Replaced String : $result"
output:
Original String : ./test.6.0.19.nupkg
Replaced String :
I need to replace the ./
to ""
Excepted output:
Original String : ./test.6.0.19.nupkg
Replaced String : test.6.0.19.nupkg