- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: print for file
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-10-2006 02:55 AM
08-10-2006 02:55 AM
print for file
How to print in the bigining of the output of a command the name of the machine ?? ..
The name is easy uname -s but i dont now how to put in the beginig of each line ..
regards ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:02 AM
08-10-2006 03:02 AM
Re: print for file
what are you trying to print ?
where are you trying to print to ? terminal screen or printer ?
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:04 AM
08-10-2006 03:04 AM
Re: print for file
uname -s > file1
cat file2 >> file1
mv file1 file2
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:05 AM
08-10-2006 03:05 AM
Re: print for file
could you pleas clarify or give example.
For example:
To change the prompt:
export PS1=`uname -n`
To prefix all lines in a file:
sed "1,$ s/^/hostname /" file > file.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:05 AM
08-10-2006 03:05 AM
Re: print for file
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:06 AM
08-10-2006 03:06 AM
Re: print for file
#!/usr/bin/sh
HOST=$(uname -n)
ls -l /etc | while read X
do
echo "${HOST}: ${X}"
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:45 AM
08-10-2006 03:45 AM
Re: print for file
I already solv my problem whit awk !!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 11:18 PM
08-10-2006 11:18 PM
Re: print for file
if you are happy with the replies, can you please see:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
and give more info on your solution, so future users can learn.