Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Single UNIX command to display users and to count them Post 302739429 by sreyan32 on Tuesday 4th of December 2012 07:40:57 AM
Old 12-04-2012
Question

Quote:
Originally Posted by Skrynesaver
Something like this might do it
Code:
  w | tail -$(( $(w| wc -l) - 2 ))  | tee >(cut -d\  -f1|uniq | wc -l >/dev/stderr )

Can you please break up this command and explain it to me. I am completely new to unix and don't understand it. But it has worked flawlessly.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to use more than one MPE command STREAM with Unix command in a single shell?

Hello, I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name3>' |... (0 Replies)
Discussion started by: bosskr
0 Replies

2. HP-UX

How to use more than one MPE command STREAM with Unix command in a single shell?

Hello, I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name3>' |... (1 Reply)
Discussion started by: bosskr
1 Replies

3. UNIX for Dummies Questions & Answers

run command Unix on a single line

Hi everybody.. I need to enter in bash mode and then run a command and this just in a single command line. I tried : "bash ^M| somecommand" but nothing.. How do I do to simulate the return button just right after the bash command ? Thanks.. (8 Replies)
Discussion started by: Riddick61
8 Replies

4. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies

5. UNIX for Dummies Questions & Answers

Re: How To Use UNIQ UNIX Command On single Column

Hi , Can You Please let Know How use unix uniq command on a single column for deleting records from file with Below Structure.Pipe Delimter File . Source Name | Account_Id A | 101 B... (2 Replies)
Discussion started by: anudeepkumar123
2 Replies

6. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (2 Replies)
Discussion started by: rehantayyab82
2 Replies

7. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code: archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (0 Replies)
Discussion started by: rehantayyab82
0 Replies

8. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies

9. UNIX for Beginners Questions & Answers

Get count of multiple word in single command

Hello Experts, I have a log file that contains 4 different type of exception : 1- Exception 2- Fatal 3- Error 4- Exec My requirement is to find count of each type of exception, i tried using combination of -E and -C but that doesn't seems to be working : grep -ec 'Exception' -ec... (4 Replies)
Discussion started by: mukulverma2408
4 Replies

10. UNIX for Beginners Questions & Answers

How to find the count of IP addresses that belong to different subnets and display the count?

Hi, I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output Here is how my file looks like 1.1.1.1 1.1.1.2 1.1.1.3 1.1.2.1 1.1.2.2 1.1.3.1 1.1.3.2 1.1.3.3 1.1.3.4 So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
XKIBITZ(1)						      General Commands Manual							XKIBITZ(1)

NAME
xkibitz - allow multiple people to interact in an xterm SYNOPSIS
xkibitz [ xkibitz-args ] [ program program-args... ] INTRODUCTION
xkibitz allows users in separate xterms to share one shell (or any program that runs in an xterm). Uses include: o A novice user can ask an expert user for help. Using xkibitz, the expert can see what the user is doing, and offer advice or show how to do it right. o By running xkibitz and then starting a full-screen editor, people may carry out a conversation, retaining the ability to scroll backwards, save the entire conversation, or even edit it while in progress. o People can team up on games, document editing, or other cooperative tasks where each person has strengths and weaknesses that complement one another. o If you want to have a large number of people do an on-line code walk-through, you can sit two in front of each workstation, and then connect them all together while you everyone looks at code together in the editor. USAGE
To start xkibitz, one user (the master) runs xkibitz with no arguments. xkibitz starts a new shell (or another program, if given on the command line). The user can interact normally with the shell, or upon entering an escape (described when xkibitz starts) can add users to the interaction. To add users, enter "+ display" where display is the X display name. If there is no ":X.Y" in the display name, ":0.0" is assumed. The master user must have permission to access each display. Each display is assigned a tag - a small integer which can be used to reference the display. To show the current tags and displays, enter "=". To drop a display, enter "- tag" where tag is the display's tag according to the "=" command. To return to the shared shell, enter "return". Then the keystrokes of all users become the input of the shell. Similarly, all users receive the output from the shell. To terminate xkibitz it suffices to terminate the shell itself. For example, if any user types ^D (and the shell accepts this to be EOF), the shell terminates followed by xkibitz. Normally, all characters are passed uninterpreted. However, in the escape dialogue the user talks directly to the xkibitz interpreter. Any Expect(1) or Tcl(3) commands may also be given. Also, job control may be used while in the interpreter, to, for example, suspend or restart xkibitz. Various processes can produce various effects. For example, you can emulate a multi-way write(1) session with the command: xkibitz sleep 1000000 ARGUMENTS
xkibitz understands a few special arguments which should appear before the program name (if given). Each argument should be separated by whitespace. If the arguments themselves takes arguments, these should also be separated by whitespace. -escape sets the escape character. The default escape character is ^]. -display adds a display much like the "+" command. Multiple -display flags can be given. For example, to start up xkibitz with three additional displays: xkibitz -display mercury -display fox -display dragon:1.0 CAVEATS
Due to limitations in both X and UNIX, resize propagation is weak. When the master user resizes the xterm, all the other xterms are logically resized. Unfortunately, xkibitz cannot force the physical xterm size to correspond with the logical xterm sizes. The other users are free to resize their xterm but their sizes are not propagated. The master can check the logical sizes with the "=" command. Deducing the window size is a non-portable operation. The code is known to work for recent versions of SunOS, AIX, Unicos, and HPUX. Send back mods if you add support for anything else. ENVIRONMENT
The environment variable SHELL is used to determine and start a shell, if no other program is given on the command line. If the environment variable DISPLAY is defined, its value is used for the display name of the xkibitz master (the display with tag number 0). Otherwise this name remains empty. Additional arguments may be passed to new xterms through the environment variable XKIBITZ_XTERM_ARGS. For example, to create xterms with a scrollbar and a green pointer cursor: XKIBITZ_XTERM_ARGS="-sb -ms green" export XKIBITZ_XTERM_ARGS (this is for the Bourne shell - use whatever syntax is appropriate for your favorite shell). Any option can be given that is valid for the xterm command, with the exception of -display, -geometry and -S as those are set by xkibitz. SEE ALSO
Tcl(3), libexpect(3) kibitz(1) "Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. "kibitz - Connecting Multiple Interactive Programs Together", by Don Libes, Software - Practice & Experience, John Wiley & Sons, West Sus- sex, England, Vol. 23, No. 5, May, 1993. AUTHOR
Don Libes, National Institute of Standards and Technology 06 October 1994 XKIBITZ(1)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy