Sponsored Content
Full Discussion: generate level numbers
Top Forums Shell Programming and Scripting generate level numbers Post 302136937 by Perderabo on Thursday 20th of September 2007 02:28:48 PM
Old 09-20-2007
How about:
Code:
$ cat data1
A NULL
B1 A
B2 A
B3 B1
C B3
C B2
$ awk '{r[NR]=$0 ; k[NR]=$1 ; if(v[$1]<1+v[$2]) v[$1]=1+v[$2] } END { for (n=1; n<=NR; n++) print r[n] , v[k[n]]}' data1
A NULL 1
B1 A 2
B2 A 2
B3 B1 3
C B3 4
C B2 4
$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to generate a series of numbers

Hi All, I have a requirement where in I have an input as follows:- input=1-4,6,8-10,12-15 I need to explode this range into an output file as follows:- 1 2 3 4 6 8 9 10 12 13 14 15 My input may vary like 1,5-9,11-13,15-17....... (3 Replies)
Discussion started by: rony_daniel
3 Replies

2. Shell Programming and Scripting

How to generate 10.000 unique numbers?

hello, does anybody can give me a hint on how to generate a lot of numbers which are not identically via scripting etc? (7 Replies)
Discussion started by: xrays
7 Replies

3. Shell Programming and Scripting

Generate numbers 000 to 999

I have tried to make this script to generate: 000 001 002 ... 997 998 999 i=0 while do if then echo "00"$i else if && then echo "0"$i (5 Replies)
Discussion started by: locoroco
5 Replies

4. Programming

generate array of random numbers

hi guys, I am writing a c program that generates a two dimensional array to make matrix and a vector of random numbers and perform multiplication. I can't figure out whats wrong with my code. It generates a matrix of random numbers but all the numbers in the vector array is same and so is the... (2 Replies)
Discussion started by: saboture88
2 Replies

5. Shell Programming and Scripting

Generate Codes based on start and End values of numbers in a column

Hello All, Could you please help with this. This is what I have: 506234.222 2 506234.222 2 506234.222 2 506234.222 2 508212.200 2 508212.200 2 333456.111 2 333456.111 2 333456.111 2 333456.111 2 But this is what I want: 506234.222 1 506234.222 2 506234.222 2 506234.222 3 (5 Replies)
Discussion started by: canimba
5 Replies

6. Shell Programming and Scripting

Generate 16 digit positive random Numbers

Hi Unix Gurus, I have a requirement to generate positive random 16 and 13 digit numbers. Here is the script I have so far..... number=$RANDOM$RANDOM$RANDOM$RANDOM; let "number %= 10000000000000"; echo $number But sometimes it is generating negative numbers and also 15 digit... (8 Replies)
Discussion started by: scorpioraghu
8 Replies

7. Shell Programming and Scripting

Generate random numbers in script

i want to generate a random number through a script, and even if anyone reads the script, they wont be able to figure out what the random number is. only the person who setup the script would know it. something like this could work: random the full thread is here: ... (13 Replies)
Discussion started by: SkySmart
13 Replies

8. Shell Programming and Scripting

Auto generate Line Numbers

How do I generate line numbers in Vi? I have this: ,'04-90020-039N','61423','2GDV00039-0002', SYSDATE); ,'04-90020-040D','61423','2GDV00046-0001', SYSDATE); ,'04-90020-041N','61423','2GDV00038-0002', SYSDATE); ,'04-90020-043D','61423','2GDV00047-0001', SYSDATE);... (3 Replies)
Discussion started by: djehresmann
3 Replies

9. Shell Programming and Scripting

Need advise to generate 10 character numbers example 0000000000 - 9999999999

Hi all, i need advise from all experts here. when i use command below to print number in 10 character printf "%010d\n" {0..999} it will give me output nicely starts from 0000000000 untillllllllllll 0000000994 0000000995 0000000996 0000000997 0000000998 0000000999 However. when i... (6 Replies)
Discussion started by: jason6247
6 Replies

10. Shell Programming and Scripting

Script to generate sequence of numbers

I need awk script to generate part number sequencing based on data in multiple columns like below Input File --------- Col A|Col B|Col C| 1|a|x| 2|b|y| |c|z| | |m| | |n| And out put should be like 1ax 1ay 1az 1am 1an 1bx 1by (6 Replies)
Discussion started by: aramacha
6 Replies
lpusers(1M)						  System Administration Commands					       lpusers(1M)

NAME
lpusers - set printing queue priorities SYNOPSIS
lpusers -d priority-level lpusers -q priority-level -u login-ID-list lpusers -u login-ID-list lpusers -q priority-level lpusers -l DESCRIPTION
The lpusers command sets limits to the queue priority level that can be assigned to jobs submitted by users of the LP print service. The first form of the command (with -d) sets the system-wide priority default to priority-level, where priority-level is a value of 0 to 39, with 0 being the highest priority. If a user does not specify a priority level with a print request (see lp(1)), the default priority level is used. Initially, the default priority level is 20. The second form of the command (with -q and -u) sets the default highest priority-level (0-39) that the users in login-ID-list can request when submitting a print request. The login-ID-list argument may include any or all of the following constructs: login-ID A user on any system system_name!login-ID A user on the system system_name system_name!all All users on system system_name all!login-ID A user on all systems all All users on all systems Users that have been given a limit cannot submit a print request with a higher priority level than the one assigned, nor can they change a request that has already been submitted to have a higher priority. Any print requests submitted with priority levels higher than allowed will be given the highest priority allowed. The third form of the command (with -u) removes any explicit priority level for the specified users. The fourth form of the command (with -q) sets the default highest priority level for all users not explicitly covered by the use of the second form of this command. The last form of the command (with -l) lists the default priority level and the priority limits assigned to users. OPTIONS
The following options are supported: -d priority-level Set the system-wide priority default to priority-level. -l List the default priority level and the priority limits assigned to users. -q priority-level Set the default highest priority level for all users not explicitly covered. -q priority-level -u login-ID-list Set the default highest priority-level that the users in login-ID-list can request when submitting a print request. -u login-ID-list Remove any explicit priority level for the specified users. EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpsu | +-----------------------------+-----------------------------+ SEE ALSO
lp(1), attributes(5) SunOS 5.11 19 Aug 1996 lpusers(1M)
All times are GMT -4. The time now is 10:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy