Problem printing date

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2009
Posts: 35
Reputation: Mattpd is an unknown quantity at this point 
Solved Threads: 0
Mattpd Mattpd is offline Offline
Light Poster

Problem printing date

 
0
  #1
27 Days Ago
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'/'
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 6
Reputation: versatileint is an unknown quantity at this point 
Solved Threads: 1
versatileint versatileint is offline Offline
Newbie Poster
 
1
  #2
26 Days Ago
sed 's_in_out:'$today':'$name'_'
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC