get a random number with modulo of the number of files (i.e. pick a number between 1 and the number of files in the directory). $RANDOM is a special variable that returns a "random" number between 0 and 32K-1
tell sed not to print anything except that line number (i.e. that file)
Hi All,
We use mutt in one of our scripts to send files as a part of a batch job . The command works nicely but i want to know from where does mutt pick the sender details. As the sender id is different if i use mutt and Mail utility. I can not change the command to mail as it is a part of the... (1 Reply)
Hi,
I have a huge file say with 2000000 records. The file has 42 fields. I would like to pick randomly 1000 records from this huge file. Can anyone help me how to do this? (1 Reply)
Hi, I have a problem I am trying to solve with bash.
I need to search in a file system (data base) with hundreds of directories and thousands of subdirectories and millions of files. The files have a specific format with a header that gives the properties. Directories are organized so... (1 Reply)
Hi
In my script i am trying to access mainframe server using FTP,
in the server i have filee with the timestamp.I need to get the file with the latest timestamp among them . The server has the below files
/
ftp> cd /outbox
250 CWD command successful
ftp> ls
200 PORT command successful... (4 Replies)
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)
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)
Hello All,
I have a list of files as below
---------
FORM_PTIR_9484_ANFDOP_20150716_00263059.DAT
FORM_PTIR_9484_TIFDOP_20150716_00263059.DAT
FORM_PTIR_9484_EXFDOP_20150716_00263059.DAT
FORM_PTIR_9484_ANFDEX_20150716_00263059.DAT
FORM_PTIR_9484_ANFDCA_20150716_00263059.DAT
and so on....... (4 Replies)
Discussion started by: rac
4 Replies
LEARN ABOUT NETBSD
shuffle
SHUFFLE(1) BSD General Commands Manual SHUFFLE(1)NAME
shuffle -- print a random permutation of the command line arguments
SYNOPSIS
shuffle [-0] [-f filename ...] [-n number] [-p number] [arg] [...]
DESCRIPTION
The shuffle program prints a random permutation (or ``shuffle'') of its command line arguments. This can be useful in shell scripts for
selecting a random order in which to do a set of tasks, view a set of files, etc.
If the -f option is given, the data is taken from that files' contents or if the filename is - ``stdin''.
If the -n option is given, its argument is treated as a number, and the program prints a random permutation of the numbers greater than or
equal to 0 and less than the argument.
If the -p option is given, its argument is treated as a number, and the program prints that number of randomly selected lines or arguments in
a random order.
The -0 option changes the field separator character from
to , so that the output is suitable to be sent to xargs(1) (to handle filenames
with whitespace in them).
EXAMPLES
$ shuffle a b c d
c
b
d
a
$ shuffle -p 1 a b c d
d
$ shuffle -n 4 -p 2
0
3
SEE ALSO jot(1), random(6)HISTORY
The shuffle program first appeared in NetBSD 1.4.
AUTHORS
Written by Perry E. Metzger <perry@piermont.com>.
BSD February 18, 2009 BSD