Sponsored Content
Full Discussion: Random ordering
Top Forums Shell Programming and Scripting Random ordering Post 302757515 by johnkim0806 on Thursday 17th of January 2013 03:32:54 PM
Old 01-17-2013
Random ordering

Code:
1
2
4
5
3

I would like to use a script so that i can randomly rearrange these numbers such as

Code:
3
5
2
4
1

Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

proper ordering of o/p values

Hi, Below is my script which creates a file: #!/bin/sh if then echo "Enter bill period " echo "Syntax: sh cpd.sh G08" exit fi sqlplus uname/pwd@dbname <<EOF set WRAP off set FEEDBACK off set PAGESIZE 0 set VERIFY off (14 Replies)
Discussion started by: ss_ss
14 Replies

2. Shell Programming and Scripting

File ordering by portion of filename

Hi, Lets say I have a few xml files: 1234567894.xml abc_1234567895.xml abc_000_1234567890.xml abc_0000000_1234567893.xml 684_abc_000_1234567899.xml The naming convention of the files is: xxxxx_timestamp.xml OR timestamp.xml where x can be anything and I would like to order them by... (4 Replies)
Discussion started by: Leion
4 Replies

3. Shell Programming and Scripting

ordering a data file

With an input file like this: How can I get an output like this? (In the quoted examples, the "_" sign represents an empty space) Note that there are some minus signs and no spaces, in the example above the first character of the first line is an empty space, so each number spans 10... (16 Replies)
Discussion started by: lego
16 Replies

4. Shell Programming and Scripting

Re-ordering data

input Predictions for job: 1299399580 ********************************************** gg18_qqq10_100017878_100017978_- ============================================================================== zzz Factor: XXX, ttt: crsmsgw, Cutoff: 0.6429 seqe Position fff Coordinate K-mer Score ... (3 Replies)
Discussion started by: quincyjones
3 Replies

5. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

6. Shell Programming and Scripting

Re ordering lines - Awk

Is it possible to re-order certain rows as columns (of large files). Few lines from the file for reference. input Splicing Factor: Tra2beta, Motif: aaguguu, Cutoff: 0.5000 Sequence Position Genomic Coordinate K-mer Score 97 chr1:67052604 uacuguu 0.571 147... (3 Replies)
Discussion started by: quincyjones
3 Replies

7. Shell Programming and Scripting

ordering

file1 1 SNP2 3 1 SNP3 3 1 SNP5 4 2 SNP1 4 2 SNP4 4 file2 SNP1 1 1 1 SNP5 5 5 5 SNP4 4 4 4 SNP2 2 2 2 SNP3 1 1 1 desired output (1 Reply)
Discussion started by: johnkim0806
1 Replies

8. Shell Programming and Scripting

Ordering batch number

Hi, Could some one please help to order the batch number in sequence. I will be getting bunch of files with batch number in folder1 which are not in sequence. I need to move all files from folder1 to folder2 with batch number in sequence. Header record looks like PROCESS1... (8 Replies)
Discussion started by: zooby
8 Replies

9. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

10. Shell Programming and Scripting

Bash - re-ordering list of parameters

Hello. I have a script that writes parameters in alphabetic order. But I have a parameter which have 3 lines. There is no continuation character ( '\' ). Each of the three lines finish with 'cr'. But line 2 and 3 of the concerning parameter start with a tab char (but should be one or more... (7 Replies)
Discussion started by: jcdole
7 Replies
catch(n)						       Tcl Built-In Commands							  catch(n)

__________________________________________________________________________________________________________________________________________________

NAME
catch - Evaluate script and trap exceptional returns SYNOPSIS
catch script ?resultVarName? ?optionsVarName? _________________________________________________________________ DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. The catch command calls the Tcl interpreter recur- sively to execute script, and always returns without raising an error, regardless of any errors that might occur while executing script. If script raises an error, catch will return a non-zero integer value corresponding to the exceptional return code returned by evaluation of script. Tcl defines the normal return code from script evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return code of TCL_ERROR. The other exceptional return codes are returned by the return, break, and continue commands and in other special situa- tions as documented. Tcl packages can define new commands that return other integer values as return codes as well, and scripts that make use of the return -code command can also have return codes other than the five defined by Tcl. If the resultVarName argument is given, then the variable it names is set to the result of the script evaluation. When the return code from the script is 1 (TCL_ERROR), the value stored in resultVarName is an error message. When the return code from the script is 0 (TCL_OK), the value stored in resultVarName is the value returned from script. If the optionsVarName argument is given, then the variable it names is set to a dictionary of return options returned by evaluation of | script. Tcl specifies two entries that are always defined in the dictionary: -code and -level. When the return code from evaluation of | script is not TCL_RETURN, the value of the -level entry will be 0, and the value of the -code entry will be the same as the return code. | Only when the return code is TCL_RETURN will the values of the -level and -code entries be something else, as further described in the doc- | umentation for the return command. | When the return code from evaluation of script is TCL_ERROR, three additional entries are defined in the dictionary of return options | stored in optionsVarName: -errorinfo, -errorcode, and -errorline. The value of the -errorinfo entry is a formatted stack trace containing | more information about the context in which the error happened. The formatted stack trace is meant to be read by a person. The value of | the -errorcode entry is additional information about the error stored as a list. The -errorcode value is meant to be further processed by | programs, and may not be particularly readable by people. The value of the -errorline entry is an integer indicating which line of script | was being evaluated when the error occurred. The values of the -errorinfo and -errorcode entries of the most recent error are also avail- | able as values of the global variables ::errorInfo and ::errorCode respectively. | Tcl packages may provide commands that set other entries in the dictionary of return options, and the return command may be used by scripts | to set return options in addition to those defined above. EXAMPLES
The catch command may be used in an if to branch based on the success of a script. if { [catch {open $someFile w} fid] } { puts stderr "Could not open $someFile for writing $fid" exit 1 } There are more complex examples of catch usage in the documentation for the return command. SEE ALSO
break(n), continue(n), dict(n), error(n), return(n), tclvars(n) KEYWORDS
catch, error Tcl 8.5 catch(n)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy