- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: TIMESTAMP
Operating System - Linux
1745822
Members
3997
Online
108722
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2006 12:41 AM
тАО11-16-2006 12:41 AM
Is there any function that will re-adjust a variables value. E.g. I have a variable such as:
TIMESTAMP=`/bin/date '+%d%m%Y %H:%M:%S'`
echo "Start time: $TIMESTAMP"
...... more code etc......
echo "Finish time: $TIMESTAMP"
I know that I can insert the line before the final one to achieve this . i.e.
TIMESTAMP=`/bin/date '+%d%m%Y %H:%M:%S'`
echo "Start time: $TIMESTAMP"
...... more code etc......
TIMESTAMP=`/bin/date '+%d%m%Y %H:%M:%S'`
echo "Finish time: $TIMESTAMP"
Any other options?
TIMESTAMP=`/bin/date '+%d%m%Y %H:%M:%S'`
echo "Start time: $TIMESTAMP"
...... more code etc......
echo "Finish time: $TIMESTAMP"
I know that I can insert the line before the final one to achieve this . i.e.
TIMESTAMP=`/bin/date '+%d%m%Y %H:%M:%S'`
echo "Start time: $TIMESTAMP"
...... more code etc......
TIMESTAMP=`/bin/date '+%d%m%Y %H:%M:%S'`
echo "Finish time: $TIMESTAMP"
Any other options?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2006 12:50 AM
тАО11-16-2006 12:50 AM
Solution
If you will be using the TIMESTAMP variable only once, then there is no need for the variable existence, just use:
/bin/date +"Start Time: %d%m%Y %H:%M:%S"
.
.
.
/bin/date +"Finish Time: %d%m%Y %H:%M:%S"
/bin/date +"Start Time: %d%m%Y %H:%M:%S"
.
.
.
/bin/date +"Finish Time: %d%m%Y %H:%M:%S"
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Tags:
- date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2006 12:58 AM
тАО11-16-2006 12:58 AM
Re: TIMESTAMP
Hi:
Change the TIMESTAMP setting to look like:
# TIMESTAMP='echo `/bin/date "+%d%m%Y %H:%M:%S"`'
...adding the 'echo' and double quotes in lieu of single ones as noted. Then:
# echo "Finish time\c"; eval ${TIMESTAMP}
Regards!
...JRF...
Change the TIMESTAMP setting to look like:
# TIMESTAMP='echo `/bin/date "+%d%m%Y %H:%M:%S"`'
...adding the 'echo' and double quotes in lieu of single ones as noted. Then:
# echo "Finish time\c"; eval ${TIMESTAMP}
Regards!
...JRF...
- Tags:
- eval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2006 01:16 AM
тАО11-16-2006 01:16 AM
Re: TIMESTAMP
Thanks
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP