Sponsored Content
Top Forums Shell Programming and Scripting Grab a smaller and larger value Post 302140110 by Raynon on Wednesday 10th of October 2007 09:44:47 PM
Old 10-10-2007
Grab a smaller and larger value

Hi All,

I am trying to grab a term which is just smaller and larger than the assigned value using the below code. But there seems to be some problem. The value i assign is 25 so i would expect it to output a smaller value to be 20 instead of 10 and 20 and larger value to be 30 instead of 30 and 40. Can anybody help ?

Input:

10
20
30
40


Output:
My Value = 25
Smaller Value = 20
Bigger Value = 30


Code:
awk '$1<= 25 END{print $1}' input
awk '$1>= 25 BEGIN{print $1}' input


Last edited by vgersh99; 10-10-2007 at 10:50 PM.. Reason: code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mirror 4meg SCSI to Larger

I have a Unix based system running my POS (Point of sale) system that uses two 4.1 gig hard drives. I use the ./diskcopy command to mirror master to Backup My problem is 4.1 gig hard drives are no longer available new so I need to move to a larger cap drive but for my command to work the... (3 Replies)
Discussion started by: dolphin41
3 Replies

2. Solaris

Upgrading To Larger Disk?

I have just been assigned the task of upgrading to a larger disk on a e250; however, I am use to working on Linux and x86 hardware. I would be very appreciative if someone could inform me on how this procedure can be done safely. To begin with, the e250 has a 18 Gig primary scsi disk and a 18... (3 Replies)
Discussion started by: cstovall
3 Replies

3. UNIX for Advanced & Expert Users

sending larger files via ftp

hi all, i am looking for ways to make ftp efficient by tuning the parameters currently, tcp_max_buf is 1 MB tcp_xmit_hiwat is 48 KB say to transmit multiple 2 gb files from unix server to mainframe sys, will increasing the window size or the send buffer size of the current TCP/IP... (6 Replies)
Discussion started by: matrixmadhan
6 Replies

4. Shell Programming and Scripting

Splitting a Larger File Into Mutiple Smaller ones.

Hello.. Iam in need to urgent help with the below. Have data-file with 40,567 and need to split them into multiple files with smaller line-count. Iam aware of "split" command with -l option which allows you to specify the no of lines in smaller files ,with the target file-name pattern... (1 Reply)
Discussion started by: madhubt_1982
1 Replies

5. 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

6. AIX

Tar files larger than 2GB

Hi, Does anyone know if it is possible to tar files larger than 2GB? The reason being is they want me to dump a single file (which is around 20GB) to a tape drive and they will restore it on a Solaris box. I know the tar have a limitation of 2GB so I am thinking of a way how to overcome this.... (11 Replies)
Discussion started by: depam
11 Replies

7. AIX

Clone or mirror your AIX OS larger disk to smaller disk ?

hello folks, I have a 300GB ROOTVG volume groups with one filesystem /backup having 200GB allocated space Now, I cannot alt disk clone or mirrorvg this hdisk with another smaller disk. The disk size has to be 300GB; I tried alt disk clone and mirrorvg , it doesn't work. you cannot copy LVs as... (9 Replies)
Discussion started by: filosophizer
9 Replies

8. UNIX for Dummies Questions & Answers

Split larger files into smaller ones with Column names

Hi, I have one large files of 100000 rows with header column. Eg: Emp Code, Emp Name 101,xxx 102,YYY 103,zzz ... ... I want to split the files into smaller files with only 30000 rows each..File 1,2 and 3 must have 30000 rows and file 4 must contain 10000 rows. But the column... (1 Reply)
Discussion started by: Nivas
1 Replies

9. Shell Programming and Scripting

Larger window

I would like the window that this opens to be larger. Can it be modified to do so? Thanks. #!/usr/bin/env python3 # Text snippets are in /home/andy/.config/snippet_paste/ import os import subprocess home = os.environ directory = home+"/.config/snippet_paste" if not... (4 Replies)
Discussion started by: drew77
4 Replies
zlaesy.f(3)							      LAPACK							       zlaesy.f(3)

NAME
zlaesy.f - SYNOPSIS
Functions/Subroutines subroutine zlaesy (A, B, C, RT1, RT2, EVSCAL, CS1, SN1) ZLAESY Function/Subroutine Documentation subroutine zlaesy (complex*16A, complex*16B, complex*16C, complex*16RT1, complex*16RT2, complex*16EVSCAL, complex*16CS1, complex*16SN1) ZLAESY Purpose: ZLAESY computes the eigendecomposition of a 2-by-2 symmetric matrix ( ( A, B );( B, C ) ) provided the norm of the matrix of eigenvectors is larger than some threshold value. RT1 is the eigenvalue of larger absolute value, and RT2 of smaller absolute value. If the eigenvectors are computed, then on return ( CS1, SN1 ) is the unit eigenvector for RT1, hence [ CS1 SN1 ] . [ A B ] . [ CS1 -SN1 ] = [ RT1 0 ] [ -SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ] Parameters: A A is COMPLEX*16 The ( 1, 1 ) element of input matrix. B B is COMPLEX*16 The ( 1, 2 ) element of input matrix. The ( 2, 1 ) element is also given by B, since the 2-by-2 matrix is symmetric. C C is COMPLEX*16 The ( 2, 2 ) element of input matrix. RT1 RT1 is COMPLEX*16 The eigenvalue of larger modulus. RT2 RT2 is COMPLEX*16 The eigenvalue of smaller modulus. EVSCAL EVSCAL is COMPLEX*16 The complex value by which the eigenvector matrix was scaled to make it orthonormal. If EVSCAL is zero, the eigenvectors were not computed. This means one of two things: the 2-by-2 matrix could not be diagonalized, or the norm of the matrix of eigenvectors before scaling was larger than the threshold value THRESH (set below). CS1 CS1 is COMPLEX*16 SN1 SN1 is COMPLEX*16 If EVSCAL .NE. 0, ( CS1, SN1 ) is the unit right eigenvector for RT1. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Definition at line 116 of file zlaesy.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 zlaesy.f(3)
All times are GMT -4. The time now is 03:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy