I use this bash script sed_no_ocr.sh which has no x property (i.e. ls -al sed_no_ocr.sh shows -rw-r--r--):
#! /bin/bash
file=$1
concatenation(){
echo "sed -i -r -e 's/($1) ($2)/\1\2/;p' $file"
sed -i -r -e 's/($1) ($2)/\1\2/;p' $file
}
concatenation "bypas" "sAfromALUinWB" $file
Input file E4.13.4_orig.v:
...
assign bypas sAfromALUinWB = (IDEXrs1 == MEMWBrd) && (IDEXrs1 != 0) &&
...
I use sed 4.9. But the script fails to change the input file when running . ../sed_no_ocr.sh E4.13.4_orig.v. Running sed -r -e 's/(bypas) (sAfromALUinWB)/\1\2/p' E4.13.4_orig.v in bash works.
Q: how to make above concatenation function works in the bash script?