- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- appending hostname to filename
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
Discussions
Discussions
Forums
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
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
тАО01-15-2009 02:16 PM
тАО01-15-2009 02:16 PM
appending hostname to filename
i want to do file.hostname
i get file.
here is my script:
#!bin/sh
HOST= /bin/hostname
utility > file.$HOST
i have tried ( " ` ' { in various combinations without success.
i am probably not using the right combination (or maybe needing spaces)
thoughts?
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 02:20 PM
тАО01-15-2009 02:20 PM
Re: appending hostname to filename
HOST=`/bin/hostname`
utility > file.$HOST
Hasan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 02:23 PM
тАО01-15-2009 02:23 PM
Re: appending hostname to filename
#!/usr/bin/sh
HOST=$(hostname)
./utility > file.${HOST}
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 02:34 PM
тАО01-15-2009 02:34 PM
Re: appending hostname to filename
#!/usr/bin/sh <--- added /usr/
HOST=$(hostname)
utility >file.$HOST <-- did not need ( {
thanks everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 02:35 PM
тАО01-15-2009 02:35 PM
Re: appending hostname to filename
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 02:40 PM
тАО01-15-2009 02:40 PM
Re: appending hostname to filename
> #!/usr/bin/sh <--- added /usr/
Which had nothing to do with your problem, but is the appropriate path.
> utility >file.$HOST <-- did not need ( {
Which with the curly braces is the _preferred_ and/or _correct_ way to dereference shell variables. It tells the shell exactly where the variable name begins and ends...
Regards!
...JRF...