Sponsored Content
Top Forums Shell Programming and Scripting Limit ouput file on a shell script Post 302431282 by a_programmer on Monday 21st of June 2010 10:08:09 AM
Old 06-21-2010
The simplest way I can think of is to check the size of the log file after your loop with jstack and use tail -c to dump the last 10MB into a temp file and then rename the temp file to the original LOG_FILE.

However, if your issue is that you do not want the LOG_FILE to ever go beyond 10 MB due to disk space, then you can try putting this check within the loop immediately after the call to jstack (that can still require 20MB of disk space, depending on how much data one call to jstack generates).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is there a limit to the no. of arguments to a shell script ?

What is the maximum no. of arguments that could be passed to a shell script ? Is there any restriction ? I've a requirement where I need to pass a list of names to a unix script and I guess the number of such names is not a fixed one. It can run into hundreds. Is this feasible ? (4 Replies)
Discussion started by: hidnana
4 Replies

2. Shell Programming and Scripting

script to eliminate left and right fields and to get the ouput.

Hi Experts, I have a file as given below and want to filter out the filenames in it , by deleting left and right filds and to have the fllenames (There are spaces in the filename), Sun Jan 11 11:20:10 2009 1 0 /home/output/file2311_recent.list user1 user2 0 done Sun Jan 11 11:20:10 2009 1 0... (10 Replies)
Discussion started by: rveri
10 Replies

3. Shell Programming and Scripting

View ouput as a file

Hi all , I have a view in teradata , the ouput of that view have to be stored as a file with delimitere as '|'.Is there any possibility of doing this in unix ? Thanks in advance , Vinoth (6 Replies)
Discussion started by: vino.paal
6 Replies

4. Shell Programming and Scripting

csh shell script 'set' argument limit?

Hi , I have a script that is causing a problem that led me to think if there is a limit to the number of arguments for 'set' command in csh shell script. Here is my script: #!/bin/csh -f set top = design_top #1 set v_mbist = ( sim_mbist/*.v ) #2 set v_simlist = ( -v... (2 Replies)
Discussion started by: return_user
2 Replies

5. Shell Programming and Scripting

How to remove a file in shell script if its size exceeds limit?

How can i remove a file using shell script when its size exceeds 10MB. Given that file is located in different location to the shell script where it is running? (4 Replies)
Discussion started by: vel4ever
4 Replies

6. Shell Programming and Scripting

Call a Perl script within a bash script and store the ouput in a .txt file

I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients). I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Discussion started by: mecaka
6 Replies

7. UNIX for Dummies Questions & Answers

Wget ouput to log file

Hi all The following code will update the Dynamic DNS server at Namecheap.com. wget -O 'https://dynamicdns.park-your-domain.com/update?host=www&domain=example.com&password=your DDNS password'Would like to append the output to a log file using >> /path/path/logfile at the end of the command. ... (7 Replies)
Discussion started by: CRChamberlain
7 Replies

8. Shell Programming and Scripting

Inserting ouput into a file using redirection

Hallo Team, I would like to redirect an output from a file into another file. Here are the two commands/files. -bash-3.2$ cat lack.csv lemontwistpax -bash-3.2$ ll -ltr BW*|tail -1 -rw-r--r-- 1 mind mind 1844 Sep 25 12:06... (8 Replies)
Discussion started by: kekanap
8 Replies

9. Shell Programming and Scripting

Shell Script has different ouput via cron vs when run Manually

Hello Lads, I deployed a script on my mac to start and stop EC2 instances on AWS console. The script when started manually on the terminal does the expected stop and start. Problem is when i try to schedule it on a cron, it fails to recognize the AWS Keys which i set up as ENV variable by... (2 Replies)
Discussion started by: Irishboy24
2 Replies

10. UNIX for Beginners Questions & Answers

Shell script ouput conversion

Hi All, I am trying to print all the packages info in solaris 11 using below script. #!/usr/bin/env bash pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}' > /tmp/cp1 /usr/bin/nawk -F: ' {for (i=1; i<=NF; i++) {gsub (/^ *| *$/, "", $i) ... (5 Replies)
Discussion started by: sravani25
5 Replies
PCRE_EXEC(3)						     Library Functions Manual						      PCRE_EXEC(3)

NAME
PCRE - Perl-compatible regular expressions SYNOPSIS
#include <pcre.h> int pcre_jit_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize, pcre_jit_stack *jstack); int pcre16_jit_exec(const pcre16 *code, const pcre16_extra *extra, PCRE_SPTR16 subject, int length, int startoffset, int options, int *ovector, int ovecsize, pcre_jit_stack *jstack); int pcre32_jit_exec(const pcre32 *code, const pcre32_extra *extra, PCRE_SPTR32 subject, int length, int startoffset, int options, int *ovector, int ovecsize, pcre_jit_stack *jstack); DESCRIPTION
This function matches a compiled regular expression that has been successfully studied with one of the JIT options against a given subject string, using a matching algorithm that is similar to Perl's. It is a "fast path" interface to JIT, and it bypasses some of the sanity checks that pcre_exec() applies. It returns offsets to captured substrings. Its arguments are: code Points to the compiled pattern extra Points to an associated pcre[16|32]_extra structure, or is NULL subject Points to the subject string length Length of the subject string, in bytes startoffset Offset in bytes in the subject at which to start matching options Option bits ovector Points to a vector of ints for result offsets ovecsize Number of elements in the vector (a multiple of 3) jstack Pointer to a JIT stack The allowed options are: PCRE_NOTBOL Subject string is not the beginning of a line PCRE_NOTEOL Subject string is not the end of a line PCRE_NOTEMPTY An empty string is not a valid match PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject is not a valid match PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16 validity (only relevant if PCRE_UTF16 was set at compile time) PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32 validity (only relevant if PCRE_UTF32 was set at compile time) PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 validity (only relevant if PCRE_UTF8 was set at compile time) PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial PCRE_PARTIAL_SOFT ) match if no full matches are found PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match if that is found before a full match However, the PCRE_NO_UTF[8|16|32]_CHECK options have no effect, as this check is never applied. For details of partial matching, see the pcrepartial page. A pcre_extra structure contains the following fields: flags Bits indicating which fields are set study_data Opaque data from pcre[16|32]_study() match_limit Limit on internal resource use match_limit_recursion Limit on internal recursion depth callout_data Opaque data passed back to callouts tables Points to character tables or is NULL mark For passing back a *MARK pointer executable_jit Opaque data from JIT compilation The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. There is a complete description of the PCRE native API in the pcreapi page and a description of the JIT API in the pcrejit page. PCRE 8.30 31 October 2012 PCRE_EXEC(3)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy