I have declared a variable: today=$(date +%m/%d/%Y) and I am trying to use sed to replace the word "in" with "out:date:name" but don't know the correct syntax to make $today print correctly. I have tried quotes and double quotes and brackets but to no avail. When I do it like this, $name prints correctly, but $today prints literally "$today" sed 's/\<in\>/out:'$today':'$name'/'

sed 's_in_out:'$today':'$name'_'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.