file=”a.txt”
pattern=$1
repalcement=$2
lineNumber=$3
li=cat $file | grep -n $pattern | sed s/:/ / | awk '{print$1}' | sed -n ${lineNumber}p
li2=$((li))
echo $li2
sed “$li,${li}s/${pattern}/${repalcement}/“ $file
file=”a.txt”
pattern=$1
repalcement=$2
lineNumber=$3
li=cat $file | grep -n $pattern | sed s/:/ / | awk '{print$1}' | sed -n ${lineNumber}p
li2=$((li))
echo $li2
sed “$li,${li}s/${pattern}/${repalcement}/“ $file