Hi I would like to use sed
for the following task:
I have a shell variable called tor=hello:there/you/are/here
and I am putting an underscore everywhere I need it to transform this shell variable in a file name with underscores like so:
sed -e 's/[^A-Za-z0-9._-]/_/g' <<< $tor
The result is this one:
hello_there_you_are_here
But I would like to add an extension like this:
hello_there_you_are_here.sif
How can I add an extension with sed at the end of the line ?
sed -e 's/[^A-Za-z0-9._-]/_/g' -e 's/$/.sif/' <<< $tor