HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- temporary filename generation for ftp
Operating System - HP-UX
1836367
Members
2094
Online
110100
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
Forums
Discussions
Discussions
Discussions
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
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-15-2004 01:23 AM
11-15-2004 01:23 AM
Hi all,
I am looking for a script that generates a filename max 8chars long with a selectable letter first and the rest made of a value computed from ip and time and user so that I can put a file without risking that another machine does tha same thing.
thanks for any ideas,
Michael
I am looking for a script that generates a filename max 8chars long with a selectable letter first and the rest made of a value computed from ip and time and user so that I can put a file without risking that another machine does tha same thing.
thanks for any ideas,
Michael
Solved! Go to Solution.
- Tags:
- ftp
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2004 01:36 AM
11-15-2004 01:36 AM
Re: temporary filename generation for ftp
Hi Michael,
Have you considered using ftp's store unique facility instead? This guarantees that your file won't overwrite any other.
Regards,
John
Have you considered using ftp's store unique facility instead? This guarantees that your file won't overwrite any other.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2004 02:05 AM
11-15-2004 02:05 AM
Solution
Michael
If you can stretch to 9 characters, you could do something like this: -
echo "obase=16;$(( date ; uname -a ; id ) | cksum | cut -d" " -f1)" | bc
Basically runs date, uname, id and whatever else you might like to use, through cksum to generate a checksum. Then passes this through bc to convert to hexadecimal, and so restrict to a max 8 chars.
If you need it to be 8 chars including your "prefix", you could perhaps just cut the first or last 7 chars from this number?
If you can stretch to 9 characters, you could do something like this: -
echo "obase=16;$(( date ; uname -a ; id ) | cksum | cut -d" " -f1)" | bc
Basically runs date, uname, id and whatever else you might like to use, through cksum to generate a checksum. Then passes this through bc to convert to hexadecimal, and so restrict to a max 8 chars.
If you need it to be 8 chars including your "prefix", you could perhaps just cut the first or last 7 chars from this number?
- Tags:
- cksum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2004 02:44 AM
11-15-2004 02:44 AM
Re: temporary filename generation for ftp
Simon,
your idea is simple and ingenious. I think I will go on from there.
John,
your idea isn't bad either. Can I be sure that sunique is supported on all major platforms?
thanks both,
Michael
your idea is simple and ingenious. I think I will go on from there.
John,
your idea isn't bad either. Can I be sure that sunique is supported on all major platforms?
thanks both,
Michael
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP