to create a file of specified size


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers to create a file of specified size
# 8  
Old 04-06-2005
Don't you also need to append to the file (>>) instead of just redirecting the yrs response. The way it is I don't think the file will ever grow. Or am I missing something?
# 9  
Old 04-06-2005
No. Give it a try on the command line. You would need to use the >> operator if you were to attempt to add lines to the file after you ran the first yes command otherwise you would simply over write the first file.
# 10  
Old 04-06-2005
OK. Having it inside the loop threw me for a loop ;-) At first glance I thought it was just putting in 1 instance of the string at a time.

Thanks for the explanation.
# 11  
Old 04-06-2005
Quote:
Originally Posted by wvdeijk
OK. Having it inside the loop threw me for a loop ;-) At first glance I thought it was just putting in 1 instance of the string at a time.

Thanks for the explanation.
Actually, I think each iteration of the loop completely overwrites the file. And typing control C will abort the script as well as the yes command.

For something that works, see this.
# 12  
Old 02-06-2006
Ending script after specified time

Hi All,

I am having a script, which run fine. But what I want to do is that the script should run for specified time and terminate then ( say for a minute).

Can somebody help me for this. I would be greatful.


Thanks,
Aru
# 13  
Old 02-06-2006
Quote:
Originally Posted by aarora_98
Hi All,

I am having a script, which run fine. But what I want to do is that the script should run for specified time and terminate then ( say for a minute).

Can somebody help me for this. I would be greatful.


Thanks,
Aru
Running at specified times can be done using cron. You need to configure the crontab for that.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to get script to create a new file that lists folder content sorted by size?

I have a script that sorts and processes unsorted files to newly created directories. Its working great, but I am trying to understand the leanest method to get the script to create an additional file within each newly created directory that: Contains a list of all files in the directory... (4 Replies)
Discussion started by: Braveheart
4 Replies

2. Shell Programming and Scripting

Divide number of lines by the size of the same file. And create relational table.

I basically need to do what the title says. I have my text file. I'm still pretty new at this. At the moment I know that: 1. wc -l file.txt To get the number of lines. 2. ls -lh file.txt To get the file size. But I need to divide both numbers. Then I need to save the output in a... (7 Replies)
Discussion started by: PainMaker101
7 Replies

3. UNIX for Dummies Questions & Answers

Create csv with output filenames and file size

Hello All, Here is seeking a bit of help in trying to solve a problem. I am required to create a csv file as shown below: output.csv -> output_1,output_2,output_3,...,output_<N> filename1:20,filename2:30,filename3:30,...,filename<N>:30 by listing output_1, output_2,... , output<N> as... (3 Replies)
Discussion started by: vkumbhakarna
3 Replies

4. UNIX for Dummies Questions & Answers

Create file with fixed record size

Hello all, Linux - Is there any way of creating a new file and determining its record size upon creation? open() and creat() do not refer to record size. Thanks... (2 Replies)
Discussion started by: klafte
2 Replies

5. UNIX for Dummies Questions & Answers

need to create a file of specified size

Hi, I need to create a file using touch command . I want the size to be of 300 MB . Is it possible with touch or any other command. Thanx for your help. (2 Replies)
Discussion started by: reply2soumya
2 Replies

6. UNIX for Dummies Questions & Answers

How can create a directory with 1GB size?

How can create a directory with 1GB size? (6 Replies)
Discussion started by: johnveslin
6 Replies

7. Shell Programming and Scripting

Create n number of files of size x

What is the best way to create 'n' number of files of size 'x' lets say n and x are given as arguments to the program.. and lets say we can simply fill the files with 0s or *'s Thanks !! (2 Replies)
Discussion started by: the_learner
2 Replies

8. Shell Programming and Scripting

To create a file of spcified size

Hi By using the following command i am creating a file with specified size but it is creating with some text file. ut i want some zero equipped file. dd if=/dev/zero of=myfile bs=1024 count=10 (0 Replies)
Discussion started by: suneelkumar
0 Replies

9. AIX

User unable to create a file over 2 GB's in size

Hello, this is my first post. I have a user who cannot create a file over 2 GB's in size eventhough the FS is large file enabled and I added a special stanza in /etc/security/limits to allow an unlimited file size for this particular user (user1 - see below). ibm:/home/root (4062)#cat... (7 Replies)
Discussion started by: AIXtexas
7 Replies

10. UNIX for Dummies Questions & Answers

How to create file of fixed size?

I want to create a file, that has a fixed size, as a placeholder so no one will write to that disc and I may store backup files at a later date. how can I do this? Using HP 9000/300 computer with HP 7937 Disc Drives and HPUX 6.5 OS. (3 Replies)
Discussion started by: dblevans
3 Replies
Login or Register to Ask a Question