Fill the directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Fill the directory
# 8  
Old 04-05-2011
The first command enter the returned line into argument line parameter $* (so $1, $2, $3 ...)

see :
Code:
# echo $*

# set -- $(df -k . | tail -1)
# echo $*
/dev/md/dsk/d61 10326524 333529 9889730 4% /export
# echo $1
/dev/md/dsk/d61
# echo $2
10326524
# echo $3
333529
# echo $4
9889730
# echo $5
4%
# echo $6
/export
# echo $*
/dev/md/dsk/d61 10326524 333529 9889730 4% /export
# shift
# echo $*
10326524 333529 9889730 4% /export
# shift
# echo $*
333529 9889730 4% /export
# shift
# echo $*
9889730 4% /export
# shift
# echo $*
4% /export
# shift 2
# echo $*

#

The second command create a file of count block of 1k .
The count calculation is the total number of block divided by 100 multiplied by the threshold

this give the number of block required to fill up the FS to the wanted threshold, but we have to substract to this number of block, the number of block that are already allocated ($3).

So that count finally match the remaining number of 1K block needed to create the file that will fill the FS at the wanted threshold.
# 9  
Old 04-05-2011
Hello, 2002anand:

What's the point of all this? What are you trying to accomplish?

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fill in missing values

Hi, I have a data sample as shown below. I want to fill in the left column so that the line will be continuous. For example, between 1 and 5 should be 2,3,4. And corresponding values in the right column will be 0. Thus the expected data should look like that: 1 1 1 10 1 2 1 3 1 5 1 6 2 0... (6 Replies)
Discussion started by: theanh0508
6 Replies

2. Shell Programming and Scripting

Fill missing values with 2

Hi All, I have 100 .txt files which look like this: 3 4 5 6 7 Now, some files have some numbers missing in them and they look like this: 4 5 6 (6 Replies)
Discussion started by: shoaibjameel123
6 Replies

3. UNIX for Dummies Questions & Answers

combine and fill series

hi all! i have a script with an output like this abc 123 1246 abc 1386 abc 2589 abc 7383 what can i do if i want to fill the 2nd column with the 2nd string '123' abc 123 1246 abc 123 1386 abc 123 2589 abc 123 7383 thanks! (3 Replies)
Discussion started by: engr.jay
3 Replies

4. Shell Programming and Scripting

Zero fill a string

How do I zero fill a string. E.g pad a string to two digits m=`date "+%m"` pm=`expr $m - 1` echo $pm the above code echoes 1. I want it to echo 01. Any ideas? (3 Replies)
Discussion started by: timgolding
3 Replies

5. Programming

Zero Fill 10 position field

Hi everyone, I am using shell scripting on a Unix SCO box. It calls a C program named zerofill. I do not know anything about C. I am having an issue with a hash total that should only be zero filled 10 positions but the record has 11 positions. DEBUG RESULTS + nice -n -5 bc -l /tmp/fhash8395... (0 Replies)
Discussion started by: ski
0 Replies

6. UNIX for Dummies Questions & Answers

Fill in columns

Hi, I've got a file with several columns where some entries are missing. Example: a b c d f g h j k l p y r I need to replace the empty spaces with zero, so the new file would be: a b c d f 0 g h j k 0 l p y 0 r The original file is tab delimited. Many thansk for... (3 Replies)
Discussion started by: zajtat
3 Replies

7. UNIX for Dummies Questions & Answers

Read directory and fill a file with this information

Hello All, Got a question to make a script what reads a directory and put the file names from that directory in a file with some extra text. ls /tempdir output is: file1.gfh file2.txt file4.zzz these file names (always with an extention) must be placed in a line and written to... (2 Replies)
Discussion started by: ToXiQ
2 Replies

8. Shell Programming and Scripting

fill in missing columns

It can't be that hard, but I just can't figure it out: I have file like: File Sub-brick M_1 S_1 M_2 S_2 M_4 S_4 ... xxx 1 214 731 228 621 132 578 ... and would like to get 0 0 where M_3 S_3 is missing xxx 1 214 731 228 621 0 0 132 578 ... I wrote following script, but can't figure out... (3 Replies)
Discussion started by: avvk
3 Replies

9. Shell Programming and Scripting

Fill the Key fields : Please help us

Hi .... we are having the below file .Column 1, Column 2 ,column 3 are key fields... In the below ...for 2 nd , 3 rd row the repeated key column is missing .... i want the new file to be populated with all missing key columns. ... (11 Replies)
Discussion started by: charandevu
11 Replies

10. Shell Programming and Scripting

Fixed length (Fill out)

hello, I have a file that has lines with different lengts. I want this file to be filled up with a zero so that al the lines have the same length. Please advice? File 1: ----------- 2310 2009 830 1345 Result File 2: ---------- 2310 2009 0830 (3 Replies)
Discussion started by: peterk
3 Replies
Login or Register to Ask a Question