I want to use a sed command in as script to change the Ansible version in a file from '2.7'
to 2.9
and keep the single quotes, '
.
This is what I use, but it seems like the result does not have the single quotes:
sed -i 's/^ansible::version:.*/ansible::version:'$vers'/' /path_to_file
output:
ansible::version: 2.9
This is the content of the file:
ansible::version: '2.7'