- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: file name with date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
08-18-2003 09:03 AM
08-18-2003 09:03 AM
file name with date
I'd write a file name with the date at the end from a script, for example:
file_name_030818
I tried with:
DATE= date +%y%m%D
touch file_name_$DATE
but DATA doesn't have the correct value
What I've to do?
Thanks in advance,
M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:07 AM
08-18-2003 09:07 AM
Re: file name with date
try
DATE=`date +%y%m%D`
note the backticks and no spaces arounr the =
HTH,
Michael.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:08 AM
08-18-2003 09:08 AM
Re: file name with date
DATE=$( date +"%y%m%d")
Rgds,
JL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:10 AM
08-18-2003 09:10 AM
Re: file name with date
DATE=$(date +%Y%M%d)
touch file_name_$DATE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:11 AM
08-18-2003 09:11 AM
Re: file name with date
Try:
DATE=`date +%y%m%d`
touch file_name_$DATE
That should take care of it.
-Bryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:12 AM
08-18-2003 09:12 AM
Re: file name with date
# touch file_name_`date +%y%m%d`
OR if you want it with variables:
DATE=`date +%y%m%d`
touch testfile_$DATE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:13 AM
08-18-2003 09:13 AM
Re: file name with date
I think you need to choose another format for your date variable. The way you have it, there are forward slashes present in the date and you are unable to create a file name with the slashes in it.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 09:17 AM
08-18-2003 09:17 AM
Re: file name with date
ftplog="/tmp/${scrname}.ftplog.`/bin/date +%y%m%d%H%M%S`"
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 10:45 AM
08-18-2003 10:45 AM