#1  
Old 8th February 2010, 23:59
autogun autogun is offline
Member
 
Join Date: Sep 2009
Posts: 69
Thanks: 9
Thanked 5 Times in 5 Posts
Default Simple 'printf' question

Howdy,

I'd like to use 'printf' with '/bin/date' function on my Linux server.
For example: 'printf Today is /bin/date'
Result: Today is Mon Feb 8 23:57:43 IST 2010

What is the right way to put it?

Thanks in advance!
Reply With Quote
Sponsored Links
  #2  
Old 9th February 2010, 21:02
acomputerwiz acomputerwiz is offline
Junior Member
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default

Code:
printf "Today is `date`\n"
Note that around the "date" is a tilde ` not a single quote

\n is newline
\r is return

Enclosed in tilde's you can put any commands you want. For example:

Code:
printf "Today is `date +%M%D%Y`\n"
if you only want certain parts of the date.
Reply With Quote
The Following User Says Thank You to acomputerwiz For This Useful Post:
BorderAmigos (4th March 2010)
  #3  
Old 10th February 2010, 20:26
autogun autogun is offline
Member
 
Join Date: Sep 2009
Posts: 69
Thanks: 9
Thanked 5 Times in 5 Posts
 
Default

Thanks a bunch, acomputerwiz!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Hardy server + OpenLDAP + Samba PDC. Simple question about groups. awe HOWTO-Related Questions 3 3rd September 2009 13:20
simple question re creating two folders pattyjay General 2 17th July 2008 10:31
a simple question on sub-domain forwarding... I think... dimas Installation/Configuration 11 4th August 2007 12:38
Simple question... I think - re: multiple domains. lidocayne Installation/Configuration 1 17th July 2006 12:53
simple question: re domain www.foobar.com.foobar.com bryxal Installation/Configuration 2 2nd June 2006 23:04


All times are GMT +2. The time now is 19:59.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.