Sponsored Content
Top Forums Shell Programming and Scripting Stopping tail -f when certain string found? Post 302235312 by Chr15 on Thursday 11th of September 2008 05:05:07 PM
Old 09-11-2008
You need to grab the PID of the tail proc and kill it

if string_found
get PID && kill $PID

and then loop round

Sorry no code but hope that points you in a direction that helps.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching for file and stopping at first item found

Hello, I try to write a shell script that would list all files on a directory and stop when it finds the first item specified on a find or ls command. How can I tell to the find or ls command to stop when it finds the first ".doc" file for example ? Thank you (7 Replies)
Discussion started by: davchris
7 Replies

2. Shell Programming and Scripting

bash script tail when string found do something

Okay, I have two scripts, the first one does some stuff, and comes to a point where it has this: Right here it runs a quick script to start something that writes to a log file. /usr/bin/tail -f ${pathVar}/nohup_${servVar}.out | while read -r line do ] && continue cd ${pathVar}... (0 Replies)
Discussion started by: cbo0485
0 Replies

3. Solaris

Can't install Unicode::String due to String.so not found

CPAN.pm: Going to build G/GA/GAAS/Unicode-String-2.09.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Unicode::String cp String.pm blib/lib/Unicode/String.pm cp lib/Unicode/CharName.pm blib/lib/Unicode/CharName.pm /usr/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp... (5 Replies)
Discussion started by: PatrickBaer
5 Replies

4. UNIX for Dummies Questions & Answers

How to Tail for a specific string

Hi guys i am tailing a constantly appending log file. However, I am looking for some specific word to be seen only when there is an update. How should I look for the word "{test-0101}" in tail, so that it only shows when there is a line that contains {test-0101} ? Thanks (1 Reply)
Discussion started by: DallasT
1 Replies

5. Linux

Find String in FileName and move the String to new File if not found

Hi all, I have a question.. Here is my requirement..I have 500 files in a path say /a/b/c I have some numbers in a file which are comma seperated...and I wanted to check if the numbers are present in the FileName in the path /a/b/c..if the number is there in the file that is fine..but if... (1 Reply)
Discussion started by: us_pokiri
1 Replies

6. Shell Programming and Scripting

grep on string and printing line after until another string has been found

Hello Everyone, I just started scripting this week. I have no background in programming or scripting. I'm working on a script to grep for a variable in a log file Heres what the log file looks like. The x's are all random clutter xxxxxxxxxxxxxxxxxxxxx START: xxxxxxxxxxxx... (7 Replies)
Discussion started by: rxc23816
7 Replies

7. Shell Programming and Scripting

Grep a string and write a value to next line of found string

Hi, I have two variables x and y. i need to find a particular string in a file, a workflow name and then insert the values of x and y into the next lines of the workflow name. basically it is like as below wf_xxxxxx $$a= $$b= $$c= figo $$d=bentley i need to grep the 'wf_xxxx' and then... (6 Replies)
Discussion started by: angel12345
6 Replies

8. UNIX for Dummies Questions & Answers

Append a string on the next line after a pattern string is found

Right now, my code is: s/Secondary Ins./Secondary Ins.\ 1/g It's adding a 1 as soon as it finds Secondary Ins. Primary Ins.: MEDICARE B DMERC Secondary Ins. 1: CONTINENTAL LIFE INS What I really want to achieve is having a 1 added on the next line that contain "Secondary Ins." It... (4 Replies)
Discussion started by: newbeee
4 Replies

9. Shell Programming and Scripting

stopping tail function after ctrl + c

say i have a statement like this in a script tail -f /opt/blah/blha/user.log > final.log if ;then cat final.log | grep -i "servicer_user" > service.log cat final.log | grep -i "logic_user" > logic.log fi echo "script completed" but when the script is running if i press ctrl + c the... (4 Replies)
Discussion started by: vivek d r
4 Replies

10. Shell Programming and Scripting

Get 20 lines above string found, and 35 below string

i want to search a log for a string. when that string is found, i want to grab the a set number of lines that came before the string, and a set number of lines that come after the string. so if i search for the word "Error" in the /var/log/messages file, how can I output the 20 lines that came... (4 Replies)
Discussion started by: SkySmart
4 Replies
textutil::string(n)				    Text and string utilities, macro processing 			       textutil::string(n)

__________________________________________________________________________________________________________________________________________________

NAME
textutil::string - Procedures to manipulate texts and strings. SYNOPSIS
package require Tcl 8.2 package require textutil::string ?0.7? ::textutil::string::chop string ::textutil::string::tail string ::textutil::string::cap string ::textutil::string::uncap string ::textutil::string::longestCommonPrefixList list ::textutil::string::longestCommonPrefix ?string...? _________________________________________________________________ DESCRIPTION
The package textutil::string provides miscellaneous string manipulation commands. The complete set of procedures is described below. ::textutil::string::chop string A convenience command. Removes the last character of string and returns the shortened string. ::textutil::string::tail string A convenience command. Removes the first character of string and returns the shortened string. ::textutil::string::cap string Capitalizes the first character of string and returns the modified string. ::textutil::string::uncap string The complementary operation to ::textutil::string::cap. Forces the first character of string to lower case and returns the modified string. ::textutil::string::longestCommonPrefixList list ::textutil::string::longestCommonPrefix ?string...? Computes the longest common prefix for either the strings given to the command, or the strings specified in the single list, and returns it as the result of the command. If no strings were specified the result is the empty string. If only one string was specified, the string itself is returned, as it is its own longest common prefix. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category textutil of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
regexp(n), split(n), string(n) KEYWORDS
capitalize, chop, common prefix, formatting, prefix, string, uncapitalize textutil 0.7 textutil::string(n)
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy