- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- separate out the column
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
12-21-2005 07:17 PM
12-21-2005 07:17 PM
separate out the column
for example :
#ps -ef |grep telnet
root 10159 702 0 15:45 ? 00:00:00 in.telnetd: 192.168.0.1
how to separate out the column so that the column as below,
column 1 --> root
column 2 --> 10159
column 3 --> 702
column 4 --> 0
column 5 --> 15
column 6 --> 45
column 7 --> ?
column 8 --> 00
column 9 --> 00
column 10 --> 00
column 11 --> in.telnetd
column 12 --> 192.168.0.1
|awk {print $12} then output the result is 192.168.0.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 07:30 PM
12-21-2005 07:30 PM
Re: separate out the column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 07:33 PM
12-21-2005 07:33 PM
Re: separate out the column
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 07:47 PM
12-21-2005 07:47 PM
Re: separate out the column
may be my question is not clear , what I want is to separate the column , to let the column is separate by : and space at the same time like my above example , is it possible ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 08:26 PM
12-21-2005 08:26 PM
Re: separate out the column
ps -ef|grep telnet | awk -F " " '{print $whatyouwant}'|awk -F : ' {print $whatyouwant}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 08:29 PM
12-21-2005 08:29 PM
Re: separate out the column
echo "root 10159 702 0 15:45 ? 00:00:00 in.telnetd: 192.168.0.1" | awk '{ split($5,a,":");split($7,b,":");print $1,$2,$3,$4,a[1],a[2],$6,b[1],b[2],b[3],$8,$9,$10,$11,$12; }'
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 08:37 PM
12-21-2005 08:37 PM
Re: separate out the column
# ps -ef | grep 'telnet' | perl -an -F/:/ -e 'BEGIN{$,=" ";}{print @F;}'
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2005 08:44 PM
12-21-2005 08:44 PM
Re: separate out the column
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 02:26 AM
12-22-2005 02:26 AM
Re: separate out the column
ps -ef | grep telnet | awk -F"[ :]" '{print $12}'
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 03:03 AM
12-22-2005 03:03 AM
Re: separate out the column
\n",$8,"\n",$9,"\n",$10,"\n",$11,"\n",$12; }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 06:05 PM
12-22-2005 06:05 PM
Re: separate out the column
I tried the below script , but it will separate the column by space THEN seperate by : , if I want it will seperate by both space and : , what can I do ? thx
ps -ef | grep "telnet"|awk -F " " '{print $x }'|awk -F : ' {print $x}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 06:47 PM
12-22-2005 06:47 PM
Re: separate out the column
-Muthu