Register
Login
Contribute
Subscribe
RSS
News
FAQForge
ISPConfig
Subscribe
Contribute
Forums
Howtos
Navigation
Howtos
Linux
Android
CentOS
Debian
Fedora
Kernel
Mandriva
PCLinuxOS
SuSE
Ubuntu
Web Server
Apache
Cherokee
Lighttpd
nginx
Backup
Control Panels
ISPConfig
DNS
BIND
MyDNS
PowerDNS
djbdns
Desktop
Email
Anti-Spam/Virus
Postfix
FTP
High-Availability
Lighttpd
Monitoring
MySQL
Programming
C/C++
PHP
Samba
Security
Anti-Spam/Virus
Storage
Virtualization
KVM
OpenVZ
VMware
VirtualBox
Xen
Other
FreeBSD
Commercial
Mini-Howtos
Linux
Apache
Backup
DNS
Errors
FTP
MySQL
Networking
PHP
Postfix
Security
Sendmail
Shell
Other
ISPConfig
Forums
Contribute
Create Content
Subscription
Login
Site Map/RSS Feeds
Facebook
News
A Brief History And Guide To Linux’s Touch Experience
Rekonq 2 – 2.2 Major Features Highlighted
Linux continues to rule supercomputers
7 essentials for defending against DDoS attacks
Hardware Hacks: Onion Pi, DesignSpark and Arduino control boards
Ubuntu phone OS has eight carriers signed on to boost development
How to read 2 files alternatively line by line
Linux Foundation Sponsors IT Training Scholarship
Bridge 2013.06 Screenshot Tour
Ubuntu phone OS forms international Carrier Advisory Group
more
Recent comments
Re: ISPconfig access with or without ip !!!
1 day 6 hours ago
Is same HowTo available for
1 day 8 hours ago
Re: clarification on Kompozer instructions
1 day 20 hours ago
LAMP installation
1 day 23 hours ago
NEED TO KNOW ABOUT PART 2
2 days 3 hours ago
Try this
2 days 9 hours ago
Thank you
2 days 19 hours ago
For nightningale, I would
2 days 21 hours ago
Help please with DNS
3 days 5 hours ago
Great! I came across this
3 days 6 hours ago
Newsletter
Subscribe to HowtoForge Newsletter
and stay informed about our latest HOWTOs and projects.
(To unsubscribe from our newsletter, visit this
link
.)
English
|
Deutsch
|
Site Map/RSS Feeds
|
Advertise
HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials
>
Linux Forums
>
Programming/Scripts
Simple 'printf' question
User Name
Remember Me?
Password
Register
FAQ
Members List
Social Groups
Calendar
Search
Today's Posts
Mark Forums Read
Do you like HowtoForge? Please consider supporting us by
becoming a subscriber
.
Thread Tools
Display Modes
#
1
8th February 2010, 22:59
autogun
Member
Join Date: Sep 2009
Posts: 66
Thanks: 9
Thanked 5 Times in 5 Posts
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!
autogun
View Public Profile
Send a private message to autogun
Find all posts by autogun
Sponsored Links
#
2
9th February 2010, 20:02
acomputerwiz
Junior Member
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
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.
The Following User Says Thank You to acomputerwiz For This Useful Post:
BorderAmigos
 (4th March 2010)
acomputerwiz
View Public Profile
Send a private message to acomputerwiz
Find all posts by acomputerwiz
#
3
10th February 2010, 19:26
autogun
Member
Join Date: Sep 2009
Posts: 66
Thanks: 9
Thanked 5 Times in 5 Posts
Thanks a bunch, acomputerwiz!
autogun
View Public Profile
Send a private message to autogun
Find all posts by autogun
Bookmarks
Digg
del.icio.us
StumbleUpon
Google
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
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 Rules
Forum Jump
User Control Panel
Private Messages
Subscriptions
Who's Online
Search Forums
Forums Home
Linux Forums
HOWTO-Related Questions
Installation/Configuration
Server Operation
Desktop Operation
Kernel Questions
Programming/Scripts
Technical
Suggest HOWTO
ISPConfig 3
General
Installation/Configuration
ISPConfig 3 Priority Support
Plugins/Modules/Addons
Tips/Tricks/Mods
Feature Requests
Developers' Forum
ISPConfig 2
General
Installation/Configuration
Tips/Tricks/Mods
Feature Requests
Developers' Forum
MyDNSConfig
General
Other Forums
Smalltalk
Forum Suggestions
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
12:20
simple question re creating two folders
pattyjay
General
2
17th July 2008
09:31
a simple question on sub-domain forwarding... I think...
dimas
Installation/Configuration
11
4th August 2007
11:38
Simple question... I think - re: multiple domains.
lidocayne
Installation/Configuration
1
17th July 2006
11:53
simple question: re domain www.foobar.com.foobar.com
bryxal
Installation/Configuration
2
2nd June 2006
22:04
All times are GMT +2. The time now is
04:32
.
Contact Us
-
HowtoForge - Linux Howtos and Tutorials
-
Archive
-
Top
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Recent comments
1 day 6 hours ago
1 day 8 hours ago
1 day 20 hours ago
1 day 23 hours ago
2 days 3 hours ago
2 days 9 hours ago
2 days 19 hours ago
2 days 21 hours ago
3 days 5 hours ago
3 days 6 hours ago