06-22-2011
What is in the log? Where is the rest of the script? There is no infinite loop here.
You save some overhead doing it on a pipe and not one at a time: 'find . . . | xargs compress'
If you have many CPU and time is important, something that runs N at a time like my bctl tool speeds things up.
Compress is getting old, faster than gzip, bzip2 but with less compression, and slower than lzjb, which might also have a bit better compression, and I have not seen a lzjb command, but if you switch to zfs, you can just turn on lzjb compression and skip the script.
Last edited by DGPickett; 06-22-2011 at 10:40 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need a quick script that will serve as a sort of "real time monitor" for watching some log files. I am using Bourne shell in HP-UX 10.20. I have basically created a script that never ends, unless of course I manually terminate it. Here's the script (it's called qhistory):
clear
echo "REAL... (3 Replies)
Discussion started by: cdunavent
3 Replies
2. Shell Programming and Scripting
Hi,
I'm pretty new to UNIX shell scripting and need some help. We have an Informatica interface that dumps any files that have errors into a directory. I need to check that directory periodically for any of up to 9 files that might be in it and run a specific process for each file found. The... (3 Replies)
Discussion started by: JeffR
3 Replies
3. Shell Programming and Scripting
Hi ALL,
I need to take some command line arguments for my script and then want to run a function for each argument.I thought of using for loop as below, but its not working , can some one please help...
#!/bin/ksh
lpar1=$1
lpar2=$2
lpar3=$3
lpar4=$4
lpar5=$5
echo "$lpar1" >>lpar.txt
echo... (4 Replies)
Discussion started by: prashant43
4 Replies
4. Shell Programming and Scripting
I have about 5000 columns of data that i need to convert all of it into pecentages. for shorter colums i have been using this code:
{print $1/($1+$2)*100,$2/($1+$2),$3/($3+$4)*100 .....}
but this is a teadious process... is there anyway to do it without having to write all of them out?
sample... (20 Replies)
Discussion started by: chronicx
20 Replies
5. Shell Programming and Scripting
Hi,
PHP user here. I'm using an endless loop to perform to mimic a cron. The script does something every 20 minutes. It sleep()s in the meantime.
I have various checks that ensure that only instance can run, including a "gentleman agreement" locked file.
However, I'd like to make sure... (2 Replies)
Discussion started by: jjshell
2 Replies
6. Shell Programming and Scripting
Hi,
I want to write a while loop like this can any one say me whats wrong with my loop
USAGE="Usage: Mail.ksh"
integer i=3
while ((1<i<=3))
do
.
.
.
.
(( CMD_JUL = LSD_JUL - i ))
CUR_MAINT_DATE=$(julian2date ${CMD_JUL})
.
.
.
i=i-1
done (1 Reply)
Discussion started by: bhagya2340
1 Replies
7. Shell Programming and Scripting
When finding a string in files within a directory, one can use this:
grep -r "searchstring" dir/subdir/ > listofoccurrences.txt
For brevity sake one can enter the intended directory and use this:
grep -r "searchstring" . > listofoccurrences.txt
which as I found out leads to an endless loop,... (2 Replies)
Discussion started by: figaro
2 Replies
8. Shell Programming and Scripting
Hi All,
I've written a script to read 2 files and compare the contents using while loop but somehow when $line is not found in test2, the script will continue looping.
Below is my code, pls advise what could went wrong
TIA
Nick
for line in test1.txt | while read line
do
grep -i... (4 Replies)
Discussion started by: Nick1971
4 Replies
9. Shell Programming and Scripting
Hi,
AM very new to shell scripting and try to run a simple do while loop statement, but it ends up running endlessly. please can anyone assist, dunno what am doing wrong, any useful suggestions will be welcomed.
#!/bin/ksh
### To check a running process instance
#################... (5 Replies)
Discussion started by: bayoo
5 Replies
10. UNIX for Beginners Questions & Answers
I was practicing writing simple loops as I am a new bash user and I created this script, which turned out to be an endless loop where the echo output does not stop and I do not see where my mistake is.
#!/bin/bash
echo 'enter a number from 1 to 100'
read number
while
do
... (2 Replies)
Discussion started by: goldenlinx
2 Replies
LEARN ABOUT PHP
gzcompress
GZCOMPRESS(3) 1 GZCOMPRESS(3)
gzcompress - Compress a string
SYNOPSIS
string gzcompress (string $data, [int $level = -1], [int $encoding = ZLIB_ENCODING_DEFLATE])
DESCRIPTION
This function compresses the given string using the ZLIB data format.
For details on the ZLIB compression algorithm see the document "ZLIB Compressed Data Format Specification version 3.3" (RFC 1950).
Note
This is not the same as gzip compression, which includes some header data. See gzencode(3) for gzip compression.
PARAMETERS
o $data
- The data to compress.
o $level
- The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. If -1 is used, the default com-
pression of the zlib library is used which is 6.
o $encoding
- One of ZLIB_ENCODING_* constants.
RETURN VALUES
The compressed string or FALSE if an error occurred.
EXAMPLES
Example #1
gzcompress(3) example
<?php
$compressed = gzcompress('Compress me', 9);
echo $compressed;
?>
CHANGELOG
+--------+-----------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+-----------------------------+
| 5.4.0 | |
| | |
| | Added $encoding parameter. |
| | |
+--------+-----------------------------+
SEE ALSO
gzdeflate(3), gzinflate(3), gzuncompress(3), gzencode(3).
PHP Documentation Group GZCOMPRESS(3)