944,155 Members | Top Members by Rank

Ad:
Nov 5th, 2009
0

Problem printing date

Expand Post »
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'/'
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Mattpd is offline Offline
47 posts
since Nov 2009
Nov 6th, 2009
1
Re: Problem printing date
sed 's_in_out:'$today':'$name'_'
Reputation Points: 10
Solved Threads: 1
Newbie Poster
versatileint is offline Offline
6 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: reading input problem.
Next Thread in Shell Scripting Forum Timeline: Need SFTP script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC