Sponsored Content
Top Forums Shell Programming and Scripting Script to match lines in screen Post 302937593 by GhostMan on Friday 6th of March 2015 11:39:54 AM
Old 03-06-2015
Script to match lines in screen

I'd like to ask people who knows bash scripting to write me a script which would open a specific screen and match lines.

Here is algorithm I'm thinking about.
  1. Find SCREENS named name1, name2.... and nameX.
  2. Open them one by one and type 'STATS'
  3. Match last lines of the screen before command type and after.
  4. If lines don't match - move on to the next screen, if they do close current screen and run gaming server start line (I'll write this myself).

Note: Lines matching should be performed few times with few mins delays.

So the context of my problem is that I have few Counter-Strike gaming servers. Sometimes they crash and I have manually restart them. I'd like this to change.

I'm using Debian 6.0 32bit.

Last edited by rbatte1; 03-06-2015 at 01:43 PM.. Reason: Added LIST=1 tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to compare lines of two files and print output on screen

hey guys, I have two files both with two columns, I have already created an awk code to ignore certain lines (e.g lines that start with 963) as they wou ld begin with a certain string, however, the rest I have added together and calculated the average. At the moment the code also displays... (3 Replies)
Discussion started by: chlfc
3 Replies

2. Shell Programming and Scripting

Perl script to match a pattern and print lines

Hi I have a file (say 'file1')and I want to search for a first occurence of pattern (say 'ERROR') and print ten lines in the file below pattern. I have to code it in PERL and I am using Solaris 5.9. I appreciate any help with code Thanks Ammu (6 Replies)
Discussion started by: ammu
6 Replies

3. Shell Programming and Scripting

sed problem - delete all lines until a match on 2 lines

First of all, I know this can be more eassily done with perl or other scripting languages but, that's not the issue. I need this in sed. (or wander if it's possible ) I got a file (trace file to recreate the control file from oracle for the dba boys) which contains some lines another line... (11 Replies)
Discussion started by: plelie2
11 Replies

4. UNIX for Dummies Questions & Answers

Extracting m lines after n lines after match

Hi All, I would like to extract from a text file m lines skipping n lines after a string occurrency. Is it possible with grep? e.g. qqq ww eee rrr ttt yyy uuu I want to print 2 lines skipping 1 line after the string 'ww' result would be rrr ttt (2 Replies)
Discussion started by: f_o_555
2 Replies

5. Shell Programming and Scripting

shell script: grep multiple lines after pattern match

I have sql file containing lot of queries on different database table. I have to filter specific table queries. Let say i need all queries of test1,test2,test3 along with four lines above it and sql queries can be multi lines or in single line. Input file contains. set INSERT_ID=1; set... (1 Reply)
Discussion started by: mirfan
1 Replies

6. UNIX for Dummies Questions & Answers

awk display the match and 2 lines after the match is found.

Hello, can someone help me how to find a word and 2 lines after it and then send the output to another file. For example, here is myfile1.txt. I want to search for "Error" and 2 lines below it and send it to myfile2.txt I tried with grep -A but it's not supported on my system. I tried with awk,... (4 Replies)
Discussion started by: eurouno
4 Replies

7. Shell Programming and Scripting

Script to match strings that sometimes are splitted in 2 lines

Hello to all, I have an hexdump -C format as below: 31 54 47 55 48 4c 52 31 5f 52 31 32 31 31 32 ff 44 00 00 0E 01 32 14 56 42 17 47 48 0f ff ff ff 44 00 00 01 32 14 56 00 23 83 95 2f 42 17 47 48 00 0f ff ff 00 15 00 0a 48 00 01 5a 00 02 17 00 00 2f 00 00 30 00 00 31 00 00 ff 34 ff 44 00... (23 Replies)
Discussion started by: Ophiuchus
23 Replies

8. UNIX for Dummies Questions & Answers

awk - (URGENT!) Print lines sort and move lines if match found

URGENT HELP IS NEEDED!! I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but - Currently, script is not printing lines to File3.txt in order. - Also the matching lines are not moving out of File1.txt ... (1 Reply)
Discussion started by: High-T
1 Replies

9. Shell Programming and Scripting

Match the value & print lines from the match

Hello, I have a file contains two columns. I need to print the lines after “xxx” so i'm trying to match "xxx" & cut the lines after that. I'm trying with the grep & cut command, if there any simple way to extract this please help me. Sample file : name id AAA 123 AAB 124 AAC 125... (4 Replies)
Discussion started by: Shenbaga.d
4 Replies

10. Shell Programming and Scripting

awk to combine lines if fields match in lines

In the awk below, what I am attempting to do is check each line in the tab-delimeted input, which has ~20 lines in it, for a keyword SVTYPE=Fusion. If the keyword is found I am splitting $3 using the . (dot) and reading the portion before and after the dot in an array a. If it does have that... (12 Replies)
Discussion started by: cmccabe
12 Replies
DMXAddScreen(3) 					     Library Functions Manual						   DMXAddScreen(3)

NAME
DMXAddScreen - attach a new back-end screen SYNOPSIS
#include <X11/extensions/dmxext.h> Bool DMXAddScreen(Display *dpy, const char *displayName, unsigned int mask, DMXScreenAttributes *attr, int *screen); DESCRIPTION
DMXAddScreen() attaches a back-end screen to the Xdmx(1) server, in place of the previously detached back-end server specified by screen. displayName is the name of the new back-end display, mask specifies the field in attr that are active, and screen returns the new Xdmx(1) screen number for the attached screen. The information stored in mask and attr is identical to that used by the DMXChangeScreensAttributes(3) and DMXGetScreenAttributes(3) functions. RETURN VALUE
DMXAddScreen() will return True if the screen was successfully attached, and False otherwise. False will be returned if the -addremove- screens command line option was not specified on the Xdmx(1) command line, the input value of screen is out of range, screen is not cur- rently detached, displayName cannot be opened, has unexpected visuals, or has characteristics that do not match the previously detached screen. DMXAddScreen() can generate BadLength, BadAlloc, and BadValue errors. NOTES
Attributes that are not specified will default to 0. This may lead to unintended results. Unlike other functions in the DMX(3) API, this function uses screen for both input and output. SEE ALSO
DMXRemoveScreen(3), DMXChangeScreensAttributes(3), DMXGetScreenAttributes(3), DMX(3), Xdmx(1) X Version 11 libdmx 1.1.2 DMXAddScreen(3)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy