Sponsored Content
Full Discussion: Numbering lines in a file
Top Forums Shell Programming and Scripting Numbering lines in a file Post 30302 by WIntellect on Sunday 20th of October 2002 09:11:04 AM
Old 10-20-2002
Glad to hear it!

Smilie
 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Numbering lines in a file

Hi all, I need to number the lines in a file. I tried using "set nu" in the vi editor, but it is only temporary. Can anyone help me please. Thanx in advance. MK (1 Reply)
Discussion started by: minazk
1 Replies

2. Shell Programming and Scripting

Numbering Lines

Hello everyone, I want get numbered lines from a file. and i can do it with: sed = file.txt | sed "/./N; s/\n/ /" | sed -n "5,7p" but the output that i get is something similar to: 5 line5 6 line6 7 line7 and i want something like this (with 2points after the number): 5:... (6 Replies)
Discussion started by: vibra
6 Replies

3. UNIX for Dummies Questions & Answers

Numbering lines grep

Is there a way to number lines and use something other than ":" to separate the number from the line? Or can anyone recommend a way to replace the ":" with a tab? Here's what I'm working with: 16859:52.67 16860:46 16861:39.63 16862:33.88 16863:29.64 16864:26.27 16865:22.09... (1 Reply)
Discussion started by: jdolny
1 Replies

4. Shell Programming and Scripting

Numbering a Text File

Running into a little problem with blank lines. My file is of this format: To number each line of the file i would use: n=1 echo "$FILE" | while read line do echo "$n) $line" n=`expr $n + 1` But really, i dont want to number the blank lines. What i've tried is to use sed... (13 Replies)
Discussion started by: omgsomuchppl
13 Replies

5. Shell Programming and Scripting

numbering lines according to a condition

hello again guys, I tried to make a script but due to array's limitations I didn't succeed...so I'm asking you :) I need numbering the lines according to date (everyday I need to restart the counter) for example: ABCBD 20080101 XXX 1 FSDFD 20080101 BBB 2 FSDFD 20080102 HHH 1 and so... (3 Replies)
Discussion started by: elionba82
3 Replies

6. Shell Programming and Scripting

numbering each line in a text file

I have a simple text file. I want to number each line in that file . for example: My text file is unix my file test My output should be 1 unix 2 my file 3 test (5 Replies)
Discussion started by: pitagi
5 Replies

7. UNIX for Dummies Questions & Answers

Ghostscript output file numbering?

I am using ghostscript to convert a multi-page pdf file to individual jpg files. I am wondering if there is a way to get ghostscript to start numbering the output jpg files from zero? What i am trying to convey is that it starts naming my files from page_001.jpg, page_002.jpg, etc., and would like... (0 Replies)
Discussion started by: RacerX
0 Replies

8. Shell Programming and Scripting

help with numbering a file

Hi, All I need to do is number a file. The file looks like this > JJJJJJJJJJJJJJJJJJJJJ > JKJKJKKKKKKJJJ > MMMMYKKKJKKK what I want to do is number it so that theres a numerical value beside the >. >1 JJJJJJJJJJJJJJJJJJJJJ >2 JKJKJKKKKKKJJJ (2 Replies)
Discussion started by: kylle345
2 Replies

9. Shell Programming and Scripting

Numbering file's lines

hey a file called test : Code: hey1 hey2 hey3 ........ how to : Code: 1.hey1 2.hey2 3.hey3 .......... (3 Replies)
Discussion started by: eawedat
3 Replies

10. UNIX for Dummies Questions & Answers

numbering lines in a file

if we execute :set nu in vi mode, it displays the line numbers. so how to make this permanently in a file. Whenever i execute cat , the line numbers should be there. please help me. thanks (4 Replies)
Discussion started by: pandeesh
4 Replies
RWHOD(8)						    BSD System Manager's Manual 						  RWHOD(8)

NAME
rwhod -- system status server SYNOPSIS
rwhod [-i] [-p] [-l] [-m [ttl]] DESCRIPTION
The rwhod utility is the server which maintains the database used by the rwho(1) and ruptime(1) programs. Its operation is predicated on the ability to broadcast or multicast messages on a network. The rwhod utility operates as both a producer and consumer of status information, unless the -l (listen mode) option is specified, in which case it acts as a consumer only. As a producer of information it periodically queries the state of the system and constructs status messages which are broadcasted or multicasted on a network. As a consumer of information, it listens for other rwhod servers' status messages, vali- dating them, then recording them in a collection of files located in the directory /var/rwho. The following options are available: -i Enable insecure mode, which causes rwhod to ignore the source port on incoming packets. -p Ignore all POINTOPOINT interfaces. This is useful if you do not wish to keep dial on demand interfaces permanently active. -l Enable listen mode, which causes rwhod to not broadcast any information. This allows you to monitor other machines' rwhod informa- tion, without broadcasting your own. -m [ttl] Cause rwhod to use IP multicast (instead of broadcast) on all interfaces that have the IFF_MULTICAST flag set in their "ifnet" structs (excluding the loopback interface). The multicast reports are sent with a time-to-live of 1, to prevent forwarding beyond the directly-connected subnet(s). If the optional ttl argument is supplied with the -m flag, rwhod will send IP multicast datagrams with a time-to-live of ttl, via a SINGLE interface rather than all interfaces. ttl must be between 0 and 32 (or MAX_MULTICAST_SCOPE). Note that -m 1 is different from -m, in that -m 1 specifies transmission on one interface only. When -m is used without a ttl argument, the program accepts multicast rwhod reports from all multicast-capable interfaces. If a ttl argument is given, it accepts multicast reports from only one interface, the one on which reports are sent (which may be controlled via the host's routing table). Regardless of the -m option, the program accepts broadcast or unicast reports from all interfaces. Thus, this program will hear the reports of old, non-multicasting rwhods, but, if multicasting is used, those old rwhods will not hear the reports generated by this program. The server transmits and receives messages at the port indicated in the ``who'' service specification; see services(5). The messages sent and received, are of the form: struct outmp { char out_line[8]; /* tty name */ char out_name[8]; /* user id */ long out_time; /* time on */ }; struct whod { char wd_vers; char wd_type; char wd_fill[2]; int wd_sendtime; int wd_recvtime; char wd_hostname[32]; int wd_loadav[3]; int wd_boottime; struct whoent { struct outmp we_utmp; int we_idle; } wd_we[1024 / sizeof (struct whoent)]; }; All fields are converted to network byte order prior to transmission. The load averages are as calculated by the w(1) program, and represent load averages over the 5, 10, and 15 minute intervals prior to a server's transmission; they are multiplied by 100 for representation in an integer. The host name included is that returned by the gethostname(3) system call, with any trailing domain name omitted. The array at the end of the message contains information about the users logged in to the sending machine. This information includes the contents of the entry from the user accounting database for each non-idle terminal line and a value indicating the time in seconds since a character was last received on the terminal line. Messages received by the rwho server are discarded unless they originated at an rwho server's port or the -i option was specified. In addi- tion, if the host's name, as specified in the message, contains any unprintable ASCII characters, the message is discarded. Valid messages received by rwhod are placed in files named whod.hostname in the directory /var/rwho. These files contain only the most recent message, in the format described above. Status messages are generated approximately once every 3 minutes. The rwhod utility performs an nlist(3) on /boot/kernel/kernel every 30 minutes to guard against the possibility that this file is not the system image currently operating. SEE ALSO
ruptime(1), rwho(1) HISTORY
The rwhod utility appeared in 4.2BSD. BUGS
Status information should be sent only upon request rather than continuously. People often interpret the server dying or network communica- tion failures as a machine going down. BSD
January 21, 2010 BSD
All times are GMT -4. The time now is 11:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy