Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How can I better group my output? Post 302165339 by llsmr777 on Thursday 7th of February 2008 01:20:09 PM
Old 02-07-2008
How can I better group my output?

I have a script that puts out a list that looks like this:

bb1 newyork
bb1 pittsburg
bb2 seattle
bb2 spokane
sl1 sacramento

I want to seperate the output so that it instead has a space between each group so like this:

bb1 newyork
bb1 pittsburg

bb2 seattle
bb2 spokane

sl1 sacramento

How can I do this?

Thanks!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk help required to group output and print a part of group line and original line

Hi, Need awk help to group and print lines to format the output as shown below INPUT FORMAT set echo on set heading on set spool on /* SCHEMA1 */ CREATE TABLE T1; /* SCHEMA1 */ CREATE TABLE T2; /* SCHEMA1 */ CREATE TABLE T3; /* SCHEMA1 */ CREATE TABLE T4; /* SCHEMA1 */ CREATE TABLE T5;... (5 Replies)
Discussion started by: rajan_san
5 Replies

2. UNIX for Dummies Questions & Answers

output of file from several machines written to network share, then emailed to group.

I have a script on all the machines on my network that lists how many updates are available for each machine, and then outputs the answer to a file called updates.txt the output shows the hostname and the number of updates, like: computer_A 7 I want all these machines to output the data to... (1 Reply)
Discussion started by: glev2005
1 Replies

3. Shell Programming and Scripting

Group the output of the variable

Hi Guys, First time in scripting & first time here...:D I need help in this situation - My requirements is: I have a list e.g. list=`echo ls -l *` OR list=`sql.... select emp_id from employee ...` The Input is: ls -l OR emp_id A 4567 B 2231 C ... (2 Replies)
Discussion started by: alvingo
2 Replies

4. Shell Programming and Scripting

How to group the output of a loop

Hi Guys, This is based on my question previously posted. :) I have my shell script like this: #!/usr/bin/sh e_id=`sqlplus -s scott/tiger@DB<<eof SET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF; select emp_id from employee; quit ... (1 Reply)
Discussion started by: alvingo
1 Replies

5. Shell Programming and Scripting

How to group the output w/ limit

Hi All, Second time to post on this group :) I'm pulling my hair now 'coz I'm so dumb to produce this requirement. Requirement: I want to run a utility by limiting the no. inside my process (mov##) to be able to use in multi streaming. Here is my script: --Input: "user_list.txt"... (0 Replies)
Discussion started by: alvingo
0 Replies

6. Shell Programming and Scripting

ID - output group-memberships one per line

Hello, I am currently a little bit lost with my new shell-script. I am trying to output the results of the "id"-command as a "one per line" statement. For example: I have the user "test" with the group-memberships "group1, group2, group3". When I enter "id test" it will show me the output... (2 Replies)
Discussion started by: henryford
2 Replies

7. Shell Programming and Scripting

need a one liner to grep a group info from /etc/group and use that result to search passwd file

/etc/group tiadm::345:mk789,po312,jo343,ju454,ko453,yx879,iy345,hn453 bin::2:root,daemon sys::3:root,bin,adm adm::4:root,daemon uucp::5:root /etc/passwd mk789:x:234:1::/export/home/dummy:/bin/sh po312:x:234:1::/export/home/dummy:/bin/sh ju454:x:234:1::/export/home/dummy:/bin/sh... (6 Replies)
Discussion started by: chidori
6 Replies

8. Shell Programming and Scripting

Joining multi-line output to a single line in a group

Hi, My Oracle query is returing below o/p ---------------------------------------------------------- Ins trnas value a lkp1 x a lkp1 y b lkp1 a b lkp2 x b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies

9. Programming

Sql ORA-00937: not a single-group group function

I'm trying to return only one row with the highest value for PCT_MAX_USED. Any suggestions? When I add this code, I get the ORA-00937 error. trunc(max(decode( kbytes_max, 0, 0, (kbytes_alloc/kbytes_max)*100))) pct_max_used This is the original and returns all rows. select (select... (3 Replies)
Discussion started by: progkcp
3 Replies
groups(1)							   User Commands							 groups(1)

NAME
groups - print group membership of user SYNOPSIS
groups [user]... DESCRIPTION
The command groups prints on standard output the groups to which you or the optionally specified user belong. Each user belongs to a group specified in /etc/passwd and possibly to other groups as specified in /etc/group. Note that /etc/passwd specifies the numerical ID (gid) of the group. The groups command converts gid to the group name in the output. EXAMPLES
The output takes the following form: example% groups tester01 tester02 tester01 : staff tester02 : staff example% FILES
/etc/passwd /etc/group ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
group(4), passwd(4), attributes(5) SunOS 5.11 14 Sep 1992 groups(1)
All times are GMT -4. The time now is 08:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy