08-04-2011
Insert set -x as the second line in your script, and please post the output. Maybe there's an error somewhere in there after all.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I am very new to shell scripting. This problem seems quite easy so it should be quite easy (I hope ^^)
I want to get a random file from a directory. this file will be in one subdirectory, and it will contain spaces.
code I have got so far:
N=find ./*/*.jpg | wc -l
((N=RANDOM%N))
... (6 Replies)
Discussion started by: davidY
6 Replies
2. Programming
INFO:
The program should enter a circle radius and Id for that circle to a file, then it should search for that id and print the radius for that circle.
PROBLEM:
This program compiles but it's not searching properly.
Circle.h
#ifndef CIRCLE_H
#define CIRCLE_H
#include <iostream>... (0 Replies)
Discussion started by: VersEtreOuNe
0 Replies
3. Shell Programming and Scripting
>cat data.dat
0001 Robbert
0002 Nick
0003 Mark
.......
1000 Jarek (3 Replies)
Discussion started by: McLan
3 Replies
4. Shell Programming and Scripting
Hello,
say suppose i am processing an file emp.dat the field of which are
deptno empno empname etc
now say suppose i want to change the file to emp.lst then how can i do it? Here i what i attempted but in vain
BEGIN{
system("sort emp.dat > emp.lst")
FILENAME="emp.lst"
}
{
print... (2 Replies)
Discussion started by: salman4u
2 Replies
5. Shell Programming and Scripting
Lets say I want to pick a random file when I do an "ls" command. I don't have set number of files in each directory.
ls | head -1
This gives me the first one in each directory, is there a way to do the same but pick a random one. (3 Replies)
Discussion started by: elbombillo
3 Replies
6. Ubuntu
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
7. UNIX for Dummies Questions & Answers
Hello
Could you please help me to find a code that can randomly select 1224 lines from a file of 12240 and make tn output with 1224 line each.
my input is txt file with 12240 lines like :
13474 999003507 0 0 2 -9
13475 999003508 0 0 2 -9
13476 999003509 0 0 1 -9
13477 999003510 0 0 1 -9
... (7 Replies)
Discussion started by: biopsy
7 Replies
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
I have a directory with files that was saved all along the day at different times. Every day I have to run a program that will select 50 files for each hour which has the maximum score.
Sample file name: a_b_c_d_e_f
where a,b,c,d,e,f are double values
Score calculation:
(a + b + c + d + e... (4 Replies)
Discussion started by: shekhar2010us
4 Replies
10. UNIX for Advanced & Expert Users
I'm on Tiny Core Linux Pure64 10.1. My locale is en_US.UTF-8 and I generally have no trouble with Unicode characters with one exception: When I try to use Unicode characters in GTK applications' file selection box, I get "Invalid file name":
http://files.dantas.airpost.net/public/save_file.jpg
... (11 Replies)
Discussion started by: DevuanFan
11 Replies
LEARN ABOUT DEBIAN
data::random::wordlist
Data::Random::WordList(3pm) User Contributed Perl Documentation Data::Random::WordList(3pm)
NAME
Data::Random::WordList - Perl module to get random words from a word list
SYNOPSIS
use Data::Random::WordList;
my $wl = new Data::Random::WordList( wordlist => '/usr/share/dict/words' );
my @rand_words = $wl->get_words(10);
$wl->close();
DESCRIPTION
Data::Random::WordList is a module that manages a file containing a list of words.
The module expects each line of the word list file to contain only one word. It could thus be easily used to select random lines from a
file, but for coherency's sake, I'll keep referring to each line as a word.
The module uses a persistent filehandle so that there isn't a lot of overhead every time you want to fetch a list of random words.
However, it's much more efficient to grab multiple words at a time than it is to fetch one word at a time multiple times.
The module also refrains from reading the whole file into memory, so it can be safer to use with larger files.
METHODS
new()
Returns a reference to a new Data::Random::WordList object. Use the "wordlist" param to initialize the object:
o wordlist - the path to the wordlist file. If a path isn't supplied, the wordlist distributed with this module is used.
get_words([NUM])
NUM contains the number of words you want from the wordlist. NUM defaults to 1 if it's not specified. get_words() dies if NUM is greater
than the number of words in the wordlist. This function returns an array or an array reference depending on the context in which it's
called.
close()
Closes the filehandle associated with the word list. It's good practice to do this every time you're done with the word list.
VERSION
0.07
AUTHOR
Originally written by: Adekunle Olonoh
Currently maintained by: Buddy Burden (barefoot@cpan.org), starting with version 0.06
COPYRIGHT
Copyright (c) 2000-2011 Adekunle Olonoh. All rights reserved. This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
Data::Random
perl v5.14.2 2012-06-04 Data::Random::WordList(3pm)