- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About writing the script
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
04-03-2003 01:38 AM
04-03-2003 01:38 AM
i wrote a scrpt :
# process = w |more
#echo $process
the echo result is
userid pts/ ip time process userid pts/ ip time process userid pts/ ip time process userid pts/ ip time process userid pts/ ip time process userid pts/ ip time process ......
how to make the result as the below tidy format ? thx.
userid pts/ ip time process
userid pts/ ip time process
userid pts/ ip time process
userid pts/ ip time process
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 01:47 AM
04-03-2003 01:47 AM
Solutionwhat you are doing is assigning a set of values to variable by this command.
w | more generates some output which contains a lot of text and you are assigning this to the variable process. and when you print process, these values get printed.
what are u trying. if you could give some more info, i will be able to help.
correct me if i am wrong.
hth
-balaji
(and juno, you have never assigned points to anybody. pls login and assign points to all your replies. )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 01:52 AM
04-03-2003 01:52 AM
Re: About writing the script
Since the number of parameters in a line is variable you will not do it.
try something silly like
w|tail -n +3|cut -c1-29,50-256
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 01:53 AM
04-03-2003 01:53 AM
Re: About writing the script
# process=$(w|more)
# echo "$process"
Best regards...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 01:59 AM
04-03-2003 01:59 AM
Re: About writing the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 03:29 AM
04-03-2003 03:29 AM
Re: About writing the script
DUMP=$(w)
should suffice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 06:08 AM
04-03-2003 06:08 AM
Re: About writing the script
echo $process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 03:41 PM
04-03-2003 03:41 PM
Re: About writing the script
cat ~/dummy |while read i j k l
do
echo "$i $j $k $l"
done
rm ~/dummy