Sponsored Content
Top Forums Shell Programming and Scripting Unix random number generate in given range Post 302541065 by gr8_usk on Friday 22nd of July 2011 10:27:02 AM
Old 07-22-2011
Panyam, thanks for revert, but how do I manipulate it ? any suggestion ?
 

10 More Discussions You Might Find Interesting

1. Programming

How to generate a random number?

How to generate a random integer with specific range(for example, from 1 to 1000)? Also, how to convert a floating point number into a integer? (2 Replies)
Discussion started by: MacMonster
2 Replies

2. Shell Programming and Scripting

generate random number in korn shell

I want to be able to generate a random number within a korn shell script.. Preferably i would like to be able to state how many digits should be in this random number... ie 4 digits or 5 digits etc Any ideas? (2 Replies)
Discussion started by: frustrated1
2 Replies

3. Shell Programming and Scripting

generate random number in perl

Could any one tell how can I generate random number from (0, 100..200) in perl? Thanks! (2 Replies)
Discussion started by: zx1106
2 Replies

4. Shell Programming and Scripting

Generating random number within a specific range (0.5-1.5)

Hello, need a way to generate numbers within 0.5-1.5 range Has to be totally random: 0.6 1.1 0.8 1.5 0.6 and so on.... How to? (10 Replies)
Discussion started by: TehOne
10 Replies

5. Programming

Generate random number

I saw this formula to generate random number between two specified values in shell script.the following. $(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)) Give a example in book. Generate random number between 6 and 30.like this. $(((RANDOM%30/3+1)*3)) But I have a... (1 Reply)
Discussion started by: luoluo
1 Replies

6. UNIX for Dummies Questions & Answers

how to generate random number as as the first column of a txt file

Dear all, I have a question. I have a txt file say 4000 rows X 1800 Column. I 'd like to creat a new column as the first column which is a column of random numbers (n=4000) thanks a lot! Lin (2 Replies)
Discussion started by: forevertl
2 Replies

7. Shell Programming and Scripting

[Solved] Help with random pick 1000 number from range 1 to 150000

Hi, Do anybody knows how to use awk or any command to random print out 1000 number which start from range 1 to 150000? I know that "rand" in awk can do similar random selection. But I have no idea how to write a code that can random pick 1000 number from range 1 to 150000 :confused: ... (1 Reply)
Discussion started by: perl_beginner
1 Replies

8. Shell Programming and Scripting

Generating Random Number in certain range

Hi there I am trying to generate a random number between 40 and 70 using the shell here is my code so far and it keeps going above 70. all help much appreciated! comp=$(( RANDOM%70+40 )) echo $comp (4 Replies)
Discussion started by: faintingquiche
4 Replies

9. Shell Programming and Scripting

Help with generate a pair of random number

Hi, Is anybody experience generate a pair of random number by using awk command? I wanna to generate a pair of random number (range from 1 to 4124) and repeats it 416 times. Desired output 2 326 123 1256 341 14 3245 645 . . . I did write the below command: awk... (5 Replies)
Discussion started by: perl_beginner
5 Replies

10. OS X (Apple)

Generate a random number in a fully POSIX compliant shell, 'dash'...

Hi all... Apologies for any typos, etc... This took a while but it didn't beat me... Although there are many methods of generating random numbers in a POSIX shell this uses integer maths and a simple C source to create an executable to get epoch to microseconds accuracy if it is needed. I take... (8 Replies)
Discussion started by: wisecracker
8 Replies
INTERDIFF(1)															      INTERDIFF(1)

NAME
interdiff - show differences between two diff files SYNOPSIS
interdiff [-p n] [-U n] [-d PAT] [-Bbiqwz] [--interpolate | --combine] [--no-revert-omitted] diff1 diff2 interdiff {--help | --version} DESCRIPTION
interdiff creates a unified format diff that expresses the difference between two diffs. The diffs must both be relative to the same files. For best results, the diffs must have at least three lines of context. To reverse a patch, use /dev/null for diff2. To reduce the amount of context in a patch, use: interdiff -U1 /dev/null patchfile Since interdiff doesn't have the advantage of being able to look at the files that are to be modified, it has stricter requirements on the input format than patch(1) does. The output of GNU diff will be okay, even with extensions, but if you intend to use a hand-edited patch it might be wise to clean up the offsets and counts using recountdiff(1) first. The diffs may be in context format. The output, however, will be in unified format. OPTIONS
-h Ignored, for compatibility with older versions of interdiff. This option will go away soon. -p n When comparing filenames, ignore the first n pathname components from both patches. (This is similar to the -p option to GNU patch(1).) -q Quieter output. Don't emit rationale lines at the beginning of each patch. -U n Attempt to display n lines of context (requires at least n lines of context in both input files). (This is similar to the -U option to GNU diff(1).) -d pattern Don't display any context on files that match the shell wildcard pattern. This option can be given multiple times. Note that the interpretation of the shell wildcard pattern does not count slash characters or periods as special (in other words, no flags are given to fnmatch). This is so that ``*/basename''-type patterns can be given without limiting the number of pathname com- ponents. -i Consider upper- and lower-case to be the same. -w Ignore whitespace changes in patches. -b Ignore changes in the amount of whitespace. -B Ignore changes whose lines are all blank. -z Decompress files with extensions .gz and .bz2. --interpolate Run as ``interdiff''. This is the default. --combine Run as ``combinediff''. See combinediff(1) for more information about how the behaviour is altered in this mode. --no-revert-omitted (For interpolation mode only) When a file is changed by the first patch but not by the second, don't revert that change. --help Display a short usage message. --version Display the version number of interdiff. EXAMPLES
Basic usage: interdiff -z 3.2pre1.patch.gz 3.2pre2.patch.gz Reversing a patch: interdiff patch /dev/null Reversing part of a patch (and ignoring the rest): filterdiff -i file.c patchfile | interdiff /dev/stdin /dev/null BUGS
There are currently no known bugs in interdiff; but there are some caveats. If you find a bug, please report it (along with a minimal test case) to Tim Waugh <twaugh@redhat.com>. There are some sets of patches in which there is just not enough information to produce a proper interdiff. In this case, the strategy employed is to revert the original patch and apply the new patch. This, unfortunately, means that interdiffs are not guaranteed to be reversible. SEE ALSO
combinediff(1) AUTHOR
Tim Waugh <twaugh@redhat.com>. Man page edited by Michael K. Johnson <johnsonm@redhat.com>. patchutils 22 July 2002 INTERDIFF(1)
All times are GMT -4. The time now is 08:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy