Need to dynamically create a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to dynamically create a file
# 1  
Old 12-03-2004
Need to dynamically create a file

I'm trying to write a script that generates a file of varying size filled with random text and am having some difficulties.

The major problems are that I'm limited to csh and a lot of the systems I have to run this on don't have a /dev/random (so a wrapper around the dd if=/dev/random or dd if=/dev/zero commands won't work).

This script is going to be run on varying UNIX operating systems and, as I've said, the lowest common denominator is csh. I'd like to make this as cross-platform as possible.

Anyone have any recommendations?
# 2  
Old 12-03-2004
Could you provide a bit more information? Such as a use for such a script.
# 3  
Old 12-03-2004
Quote:
Originally posted by seg
Could you provide a bit more information? Such as a use for such a script.
Sure. I'm going to use it to generate a file to ftp to/from multiple systems for network benchmarking.

I already have all the ftp parts automated, I just can't figure out how to generate the file dynamically before ftp kicks in (I don't actually want to keep the files, they just need to be around for the ftp's).

Being limited to csh and not having /dev/random hurts a bit.
# 4  
Old 12-03-2004
Sorry bro, sound's too fishy to me. I don't see a need to create such files dynamically for 'benchmarking'. If I'm wrong then I wish you luck.
# 5  
Old 12-03-2004
cat /bin/* | dd

or something like that.
# 6  
Old 12-03-2004
Quote:
Originally posted by seg
Sorry bro, sound's too fishy to me. I don't see a need to create such files dynamically for 'benchmarking'. If I'm wrong then I wish you luck.
I'm not sure what you mean by 'fishy' but just because *you* don't see a need for it doesn't mean it isn't legitimate. I really don't want to leave 100-300MB files laying around for when my management gets a wild hair to see how our network connections are doing.

In the future, a simple "I don't know" would suffice instead of calling into question my purpose.

Someone else wish to give me a hand?
# 7  
Old 12-03-2004
Quote:
If I'm wrong then I wish you luck.
No need to get bent out of shape.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split file Dynamically

Hello , I have a flat file ( comma separated ) and want to split dynamically . If I provide input 3 then rows 1,4,7 will o/p to a file and rows 2,5,8 will redirect to 2nd file and 3,6,9 rows will go to 3rd file So 3 files will be generated . Could it be possible in Unix? (2 Replies)
Discussion started by: Pratik4891
2 Replies

2. Shell Programming and Scripting

Dynamically creating file names from portions of another file name

Not sure how to do the following, but any help would be appreciated. Has to be done using C shell (sorry about that). I have about 300 files that I need this done for, but I am only going to give one example. I will just need to know how to execute your solution through some type of loop to get... (2 Replies)
Discussion started by: jclanc8
2 Replies

3. Shell Programming and Scripting

Shell Script to Dynamically Extract file content based on Parameters from a pdf file

Hi Guru's, I am new to shell scripting. I have a unique requirement: The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this: Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies

4. Shell Programming and Scripting

Dynamically parse BibTeX and create hash of hash

Hello gurus, Iam trying to parse following BibTex file (bibliography.bib): @book{Lee2000a, abstract = {Abstract goes here}, author = {Lee, Wenke and Stolfo, Salvatore J}, title = {{Data mining approaches for intrusion detection}}, year = {2000} } @article{Forrest1996, abstract =... (0 Replies)
Discussion started by: wakatana
0 Replies

5. Shell Programming and Scripting

How to create dynamically associative array in PHP?

Hi, I have an html page like this: <html> <body> <form action="test.php" method = "post"> Enter your name:<input name="search" type = "text" size ="40"> <br> Enter your age:<input name="age" type = "text" size ="20"> <input type = "submit" name="submit" value="search"> <input type =... (1 Reply)
Discussion started by: vanitham
1 Replies

6. Shell Programming and Scripting

How to dynamically create user name in perl and move the files?

Hi, I have two problems in which i have stuck up. a) To move the files and copy back. b) To create user dynamically. Question 1: I have to move the files to some other directory and copy it when all the process is done. I have the code like this: $file = "/home/data/file1.txt";... (2 Replies)
Discussion started by: vanitham
2 Replies

7. Shell Programming and Scripting

how to create the files dynamically in c shell script

how can i CREATE a txt file dynamically in c shell: for instance: #! /bin/csh for each i (*) cat>file$i.txt for each j do .... (1 Reply)
Discussion started by: jdsignature88
1 Replies

8. Shell Programming and Scripting

How to create hash dynamically in perl?

Hi, I have one file name file.txt It has the following contents: #File Contents StartTime,EndTime,COUNTER1,COUNTER2,COUNTER3 12:13,12:14,0,1,0 The output should be like this: StartTime: 12:13 ENDTIME: 12:14 (2 Replies)
Discussion started by: vanitham
2 Replies

9. Shell Programming and Scripting

Dynamically create arrays

I have a bash challenge. I have several virtualization hosts for which I need to collect VM information. I need to dynamically create an array for each host. The contents of the array should be the list VMs running on the host. Here's the logic; I just need someone to help me with the details:... (0 Replies)
Discussion started by: EdgarTorres
0 Replies

10. Shell Programming and Scripting

Dynamically locating a file

Hi, I have a requriement where in I need to install a s/w by executing the installable file through a script. The script currently contains the path of the installable file. I need to now update the script accordingly such tht it identifies the location of the installable file automatically and... (1 Reply)
Discussion started by: yoursdavinder
1 Replies
Login or Register to Ask a Question