I have a script:
$cat ifile.sh
extension="name.f"
parameter_list="abc,xyz,stuv,ptq,rhu"
echo newfiles are $parameter_list
I would like to execute the ifile.sh and output should replace the comma , with extension i.e. _name.f. So my desire output will be
$sh ifile.sh
newfiles are abc_name.f xyz_name.f stuv_name.f ptq_name.f rhu_name.f
So I need to modify the echo newfiles are $parameter_list. I am trying with the follwoing
$cat ifile.sh
extension="name.f"
parameter_list="abc,xyz,stuv,ptq,rhu"
echo newfiles are sed -i 's/,/$extension/g' $parameter_list