Sponsored Content
Top Forums Shell Programming and Scripting Largest number in array. Help! Post 302610933 by Scrutinizer on Thursday 22nd of March 2012 03:33:52 AM
Old 03-22-2012
Unless it is for learning purposes, in this case there is no need for arrays.

Code:
BIG=0
printf "\tEnter a list of numbers, separated by spaces: "
read list
for i in $list; do
  if [ $i -gt $BIG ]; then
    BIG=$i
  fi
done
printf "%s\n" "Largest number is $BIG"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search the largest number and duplicates string

Hi, My input file contain list of username, and it may have name with number as a suffix (if duplicated). Ex: mary john2 mike john3 john5 mary10 alexa So i want to check with a specific username (without suffix number) how many duplicated name, and what is the... (13 Replies)
Discussion started by: fongthai
13 Replies

2. Shell Programming and Scripting

checking the smallest and largest number

Hi All, My script is reading a log file line by line log file is like ; 19:40:22 :INFO Total time taken to Service External Request---115ms 19:40:25 DEBUG : Batch processed libdaemon.x86_64 0-0.10-5.el5 - u 19:40:22 INFO Total time taken to Service External Request---20ms 19:40:24... (4 Replies)
Discussion started by: subin_bala
4 Replies

3. UNIX for Dummies Questions & Answers

How to print largest and smallest number.

Hey. This is pretty easy stuff but I'm learning the basics of Unix at the moment so keep that in mind. I have to: 1) Write a C-shell script to monitor user activity on the server for 13 minutes. 2) Then print the smallest and largest number of users during these 13 minutes. I have this: 1)... (2 Replies)
Discussion started by: amp10388
2 Replies

4. Shell Programming and Scripting

perl + array and incrementing number

morning guys and gals, I am haveing a problem, a friend helped me out with this script but i dont know how to add incrementing number for each movie in movie.list. this is what i have so far. any assistance would be great. I have removed the GT and LT symbols so you can see what is going on... (5 Replies)
Discussion started by: Optimus_P
5 Replies

5. Shell Programming and Scripting

How to insert the number to an array

Hi I work in ksh88 and have a file which has several "set -A " statements: set -A PNUM_LSTM 2713 4124 2635 270 2529 2259 2214 set -A PNUM_LSTM $* for pn in ${PNUM_LSTM} etc... I need to add another number, lets say 555, to the first line ONLY so only the the first line will be updated... (2 Replies)
Discussion started by: aoussenko
2 Replies

6. Shell Programming and Scripting

How to initialize array with a larger number?

Language: ksh OS: SunOS I have been getting the 'subscript out of range' error when the below array variable gets elements greater that 1024. I understand that 1024 is the default size for 'set -A' dynamic array, but is there a way to initialize it with a larger number? set -A arr `grep... (6 Replies)
Discussion started by: ChicagoBlues
6 Replies

7. Shell Programming and Scripting

awk second largest, third largest value

I have two text files like this: file1.txt: 133 10 133 22 133 13 133 56 133 78 133 98 file2.txt: 158 38 158 67 158 94 158 17 158 23 I'm basically trying to have awk check the second largest value of the second column of each text file, and cat it to its own text file. There... (13 Replies)
Discussion started by: theawknewbie
13 Replies

8. Shell Programming and Scripting

Taking largest (negative) number from column of coordinates and adding positive form to every other

Hello all, I'm new to the forums and hope to be able to contribute something useful in the future; however I must admit that what has prompted me to join is the fact that currently I need help with something that has me at the end of my tether. I have a PDB (Protein Data Bank) file which I... (13 Replies)
Discussion started by: crunchgargoyle
13 Replies

9. Shell Programming and Scripting

Locating the largest number and performing division

I have a tab delimited file with the following format 1 r 109 45 3 5 6 7 2 f 300 249 5 8 10 3 g 120 4 5 110 0 4 t 400 300 250 0 0 ..... ..... 100,000 lines I would like to get the largest number in columns 4, 5, 6, 7, 8 and divide that largest number with the number in column 3.... (4 Replies)
Discussion started by: Kanja
4 Replies

10. Shell Programming and Scripting

Reduce the number of lines by using Array

I have the following code to count the number of how many times the name occurred in one file. The code is working fine and the output is exactly what I want. The problem is the real code has more than 50 names in function listname which cause function name to have more than 50 case ,and function... (14 Replies)
Discussion started by: samsan
14 Replies
Locale::RecodeData::ISO_5427_EXT(3)			User Contributed Perl Documentation		       Locale::RecodeData::ISO_5427_EXT(3)

NAME
Locale::RecodeData::ISO_5427_EXT - Conversion routines for ISO_5427_EXT SYNOPSIS
This module is internal to libintl. Do not use directly! DESCRIPTION
This module is generated and contains the conversion tables and routines for ISO_5427-EXT. COMMENTS
The following comments have been extracted from the original charmap: version: 1.0 repertoiremap: mnemonic,ds source: ECMA registry alias ISO-IR-54 alias ISO_5427:1981 Please note that aliases listed above are not necessarily valid! CHARACTER TABLE
The following table is sorted in the same order as the original charmap. All character codes are in hexadecimal. Please read 'ISO-10646' as 'ISO-10646-UCS4'. Local | ISO-10646 | Description -------+-----------+------------------------------------------------- 00 | 00000000 | NULL (NUL) 01 | 00000001 | START OF HEADING (SOH) 02 | 00000002 | START OF TEXT (STX) 03 | 00000003 | END OF TEXT (ETX) 04 | 00000004 | END OF TRANSMISSION (EOT) 05 | 00000005 | ENQUIRY (ENQ) 06 | 00000006 | ACKNOWLEDGE (ACK) 07 | 00000007 | BELL (BEL) 08 | 00000008 | BACKSPACE (BS) 09 | 00000009 | CHARACTER TABULATION (HT) 0A | 0000000A | LINE FEED (LF) 0B | 0000000B | LINE TABULATION (VT) 0C | 0000000C | FORM FEED (FF) 0D | 0000000D | CARRIAGE RETURN (CR) 0E | 0000000E | SHIFT OUT (SO) 0F | 0000000F | SHIFT IN (SI) 10 | 00000010 | DATALINK ESCAPE (DLE) 11 | 00000011 | DEVICE CONTROL ONE (DC1) 12 | 00000012 | DEVICE CONTROL TWO (DC2) 13 | 00000013 | DEVICE CONTROL THREE (DC3) 14 | 00000014 | DEVICE CONTROL FOUR (DC4) 15 | 00000015 | NEGATIVE ACKNOWLEDGE (NAK) 16 | 00000016 | SYNCHRONOUS IDLE (SYN) 17 | 00000017 | END OF TRANSMISSION BLOCK (ETB) 18 | 00000018 | CANCEL (CAN) 19 | 00000019 | END OF MEDIUM (EM) 1A | 0000001A | SUBSTITUTE (SUB) 1B | 0000001B | ESCAPE (ESC) 1C | 0000001C | FILE SEPARATOR (IS4) 1D | 0000001D | GROUP SEPARATOR (IS3) 1E | 0000001E | RECORD SEPARATOR (IS2) 1F | 0000001F | UNIT SEPARATOR (IS1) 20 | 00000020 | SPACE 40 | 00000491 | CYRILLIC SMALL LETTER GHE WITH UPTURN 41 | 00000452 | CYRILLIC SMALL LETTER DJE 42 | 00000453 | CYRILLIC SMALL LETTER GJE 43 | 00000454 | CYRILLIC SMALL LETTER UKRAINIAN IE 44 | 00000451 | CYRILLIC SMALL LETTER IO 45 | 00000455 | CYRILLIC SMALL LETTER DZE 46 | 00000456 | CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 47 | 00000457 | CYRILLIC SMALL LETTER YI 48 | 00000458 | CYRILLIC SMALL LETTER JE 49 | 00000459 | CYRILLIC SMALL LETTER LJE 4A | 0000045A | CYRILLIC SMALL LETTER NJE 4B | 0000045B | CYRILLIC SMALL LETTER TSHE 4C | 0000045C | CYRILLIC SMALL LETTER KJE 4D | 0000045E | CYRILLIC SMALL LETTER SHORT U 4E | 0000045F | CYRILLIC SMALL LETTER DZHE 50 | 00000463 | CYRILLIC SMALL LETTER YAT 51 | 00000473 | CYRILLIC SMALL LETTER FITA 52 | 00000475 | CYRILLIC SMALL LETTER IZHITSA 53 | 0000046B | CYRILLIC SMALL LETTER BIG YUS 5B | 0000005B | LEFT SQUARE BRACKET 5D | 0000005D | RIGHT SQUARE BRACKET 5F | 0000005F | LOW LINE 60 | 00000490 | CYRILLIC CAPITAL LETTER GHE WITH UPTURN 61 | 00000402 | CYRILLIC CAPITAL LETTER DJE 62 | 00000403 | CYRILLIC CAPITAL LETTER GJE 63 | 00000404 | CYRILLIC CAPITAL LETTER UKRAINIAN IE 64 | 00000401 | CYRILLIC CAPITAL LETTER IO 65 | 00000405 | CYRILLIC CAPITAL LETTER DZE 66 | 00000406 | CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 67 | 00000407 | CYRILLIC CAPITAL LETTER YI 68 | 00000408 | CYRILLIC CAPITAL LETTER JE 69 | 00000409 | CYRILLIC CAPITAL LETTER LJE 6A | 0000040A | CYRILLIC CAPITAL LETTER NJE 6B | 0000040B | CYRILLIC CAPITAL LETTER TSHE 6C | 0000040C | CYRILLIC CAPITAL LETTER KJE 6D | 0000040E | CYRILLIC CAPITAL LETTER SHORT U 6E | 0000040F | CYRILLIC CAPITAL LETTER DZHE 6F | 0000042A | CYRILLIC CAPITAL LETTER HARD SIGN 70 | 00000462 | CYRILLIC CAPITAL LETTER YAT 71 | 00000472 | CYRILLIC CAPITAL LETTER FITA 72 | 00000474 | CYRILLIC CAPITAL LETTER IZHITSA 73 | 0000046A | CYRILLIC CAPITAL LETTER BIG YUS 7F | 0000007F | DELETE (DEL) AUTHOR
Copyright (C) 2002-2009, Guido Flohr <guido@imperia.net>, all rights reserved. See the source code for details. This software is contributed to the Perl community by Imperia (<http://www.imperia.net/>). SEE ALSO
Locale::RecodeData(3), Locale::Recode(3), perl(1) POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 787: =cut found outside a pod block. Skipping to next block. perl v5.16.3 2014-06-10 Locale::RecodeData::ISO_5427_EXT(3)
All times are GMT -4. The time now is 07:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy