Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Help needed to modify search functionality Post 303045577 by SIMMS7400 on Thursday 2nd of April 2020 07:25:46 AM
Old 04-02-2020
They all worked flawlessly!!! Thank you so much!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help needed in search string

Hi , I learning shell scripting.. I need to do the following in my shell script. Search a given logfile for two\more strings. If the the two strings are found. write it to a outputfile if only one of the string is found, write the found string in one output file and other in other... (2 Replies)
Discussion started by: amitrajvarma
2 Replies

2. UNIX for Advanced & Expert Users

search a replace each line- help needed ASAP

can someone help me with the find and replace command. I have a input file which is in the below format: 0011200ALN00000000009EGYPT 000000000000199900000 0011200ALN00000000009EGYPT 000000000000199900000 0011200ALN00000000008EGYPT 000000000000199800000 0011200ALN00000000009EGYPT ... (20 Replies)
Discussion started by: bsandeep_80
20 Replies

3. UNIX for Dummies Questions & Answers

modify a particular pattern starting from second line of the search pattern

Hi, I am new to this forum and i would like to get help in this issue. I have a file 1.txt as shown: apple banana orange apple grapes banana orange grapes orange .... Now i would like to search for pattern say apple or orange and then put a # at the beginning of the pattern... (2 Replies)
Discussion started by: imas
2 Replies

4. UNIX for Dummies Questions & Answers

modify a particular pattern starting from second line of the search pattern

Hi, I think you ppl did not get my question correctly, let me explain I have 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: ... (1 Reply)
Discussion started by: imas
1 Replies

5. Shell Programming and Scripting

Help with search and delete/add/modify script

Gurus, I need to run a script on multiple XML files in different directories and do the following (the output can be redirected to create a new file) 1. Search a pattern like "abc.mno.xyz" in an XML file, once detected, the script should delete one line above and 3 lines below (including the... (2 Replies)
Discussion started by: inditopgun
2 Replies

6. Shell Programming and Scripting

Printing 10 lines above and below the search string: help needed

Hi, The below code will search a particular string(say false in this case) and return me 10 lines above and below the search string in a file. " awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print("***********************************");print;c=a;}b{r=$ 0}' b=10 a=10 s="false" " ... (5 Replies)
Discussion started by: vimalm22
5 Replies

7. Shell Programming and Scripting

Help needed with basic search

hi, im trying to find the longest word in /usr/share/dict/words that does not contain the letter i. i've tried using the wc -L command like so: $ wc -L /usr/share/dict/words which basically tells me the longest word which is good but how do i get the longest word which Does not contain the... (7 Replies)
Discussion started by: tryintolearn
7 Replies

8. Shell Programming and Scripting

Search for a pattern and replace. Help needed

I have three variables $a, $b and $c $a = file_abc_123.txt $b = 123 $c = 100 I want to search if $b is present in $a. If it is present, then i want to replace that portion by $c. Here $b = 123 is present in "file_abc_123.txt", so i need the output as "file_abc_100.txt' How can this be... (3 Replies)
Discussion started by: irudayaraj
3 Replies

9. Shell Programming and Scripting

Faster search needed

Hope you guys out there can help. I have 2 files as below: file 1: 111,222,333,444,555,666 777,888,999,000,111,222 111,222,333,444,555,888 file 2: 666,AAA 222,BBB 888,CCC I want to get the 6th column from file 1 (example, 666) and check in file 2 for the value in the 2nd column... (9 Replies)
Discussion started by: daytripper1021
9 Replies

10. Shell Programming and Scripting

Pattern search and modify the values

I have one file and the file may contain 500 to 15,000 records. I need to search pattern ^F509= and then increment the corresponding value by one and print the entire line. Please note that Its not a fixed length file. Can anyone please help? ex: ^F509=204656 ^F509=204656 ... (6 Replies)
Discussion started by: vinus
6 Replies
vga_runinbackground(3)						Svgalib User Manual					    vga_runinbackground(3)

NAME
vga_runinbackground - enable running of the program while there is no VGA access SYNOPSIS
#include <vga.h> void vga_runinbackground(int stat); DESCRIPTION
Enable/disable background running of a graphics program. stat = 1 enables stat = 0 disables Normally, the program is suspended while not in the current virtual console. A program can only safely run in the background if it doesn't do any video access during this time. As of version 1.2.11 this was changed by Pekka T. Alaruikka <alaruik@cc.hut.fi> & Michael Friman <no email> The support for this must be enabled in Makefile.cfg of svgalib (which it is by default). Several ways to support this may exist internally. As of now, only one using proc-fs works. Using vga_runinbackground(VGA_GOTOBACK, void (*goto)()) and vga_runinbackground(VGA_COMEFROMBACK, void (*comefrom)()) with function pointers to functions void goto(void) and void comefrom(void) you can setup function to be called when your program goes to back- ground mode and when it comes back to foreground. These can be changed at any time, and passing NULL as function disables the feature. Both these new features require a vga_runinbackground_version(3) of 1 or higher. You should check and not call it when the svgalib in use returns 0. Also, when writing applications, check with #ifdef VGA_GOTOBACK /* code using vga_runinbackground(VGA_GOTOBACK, goto) */ #else /* code using no goto or comefrom function */ #endif if you are compiling with an svgalib that supports this feature, and try to rearrange your source to work without it when an svgalib ver- sion prior to 1.2.11 is used. The function should be called right after vga_init(3). The bg_test(6) demos shows the principle operation. Please note that background capabilities are in VERY early stages. Please do not expect that EVERYTHING works flawlessly when background abilities are enabled in your program. EXAMPLE
vga_init(); vga_setmode(G320x200x256); if (vga_runinbackground_version() == 1) vga_runinbackground(1); NOTES
Before a program is left background capable, it should be tested well. Most programs will work just well. When the program is in background, it can read IO-devices (except keyboard). This can cause harm, if the programmer does not take this int account. I.e. in games using a joystick or/and mouse device the game continues reading joystick or/and mouse as it would be on foreground. The mouse can be made working correctly also in background, but this means that svgalib must be configured to use gpm mouse driver. More information about gpm-linux can be founded from latest gpm packet (by Alessandro Rubini). The goto and comefrom routines provide a way to overcome this restriction. There are so far two different methods for background running. The first method use mmap function with FIXED option, which is not recom- mended by mmap's man page. It has some probability to fail. But it allows programs to think that graphics memory is always present. The second method is just let the functions to write directly graphics memory's save-buffer. This means that the memory area where graphics information is changes for the program. The program must always know where to write. This type of action needs much more work and leaves probably always room for race conditions. Hopefully the first method proves to be good enough and second method can be left away. Neither method allows the use of the graphics card's registers in background. When registers are used, vc switching is disabled, but the request are queued. Vc switching is done as soon as possible. Generally, accelerated functions will probably cause problems, except when they are implemented carefully to check for availability of the cards registers. User programs should generally not use the graphics registers directly. But if program needs to use the registers, it has to check if it is in background or not. In the background state it can not use the registers. For testing the vga_oktowrite(3) function can be used. During register access the virtual console must be locked. A possible code fragment might look like: vga_lockvc(); if (vga_oktowrite()) { /* Register operations. */ } else { /* Registers can not be used. Alternative action. */ } vga_unlockvc(); ADVANCED NOTES
Installation Background capability is enabled in svgalib by setting BACKGROUND=y and disabled by commenting #BACKGROUND=y in Makefile.cfg before compil- ing svgalib. Background capable svgalib is more stable with all programs. Programs do not have to use background abilities even when they are available. As of this writing, all precompiled svgalib binaries are background capable by default. NOTICE: proc-fs must be mounted for background capability. Status of the background feature Background capability in svgalib is in an early stagei of development. There has been done lot of work for it, but probably not everything will work perfectly. This applies only to programs which actually enabled background running with vga_runinbackground(3). The vga_drawline(3), vga_drawpixel(3), vga_getclolors(3), vga_getpixel(3), vga_screenoff(3), vga_screenon(3), vga_setegacolor(3), vga_setrgbcolor(3), vga_setcolor(3), vga_setpage(3) and vga_clear(3) functions appear to work and calling vga_setmode(3) is safe too but cannot change modes while in background. The remaining svgalib and vgagl function should work too but are not well tested. Calling accelerated functions will most probably cause harm though this is worked on. Please report problems to Pekka (see AUTHOR section). Programming within svgalib When coding within svgalib, there are same restrictions as in user programs. SVGA registers can not be used while in background. The svgalibrary has internal functions for locking and unlocking virtual console switching __svgalib_dont_switch_vt_yet() and __svgalib_is_vt_switching_needed(). These functions are not meant to be called from user program. vga_unlockvc(3) can not release vc switching if internal svgalib locking is used. This is for safety. The procedure for registers are similar to the procedure for user pro- grams: void vga_super_new_function(void) { __svgalib_dont_switch_vt_yet(); if (vga_oktowrite()) { /* Register operations. */ } else { /* Registers can not be used. Alternative action. */ } __svgalib_is_vt_switching_needed(); } SEE ALSO
svgalib(7), vgagl(7), libvga.config(5), bg_test(6), vga_accel(3), vga_bitblt(3), vga_blitwait(3), vga_fillblt(3), vga_hlinelistblt(3), vga_imageblt(3), vga_init(3), vga_lockvc(3), vga_oktowrite(3), vga_runinbackground_version(3), vga_safety_fork(3), vga_setchipset(3), vga_setpage(3), vga_setreadpage(3), vga_setwritepage(3), vga_unlockvc(3) AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The function was implemented and documented by Pekka T. Alaruikka <alaruik@cc.hut.fi> & Michael Friman <no email>. Svgalib (>;= 1.2.11) 27 July 1997 vga_runinbackground(3)
All times are GMT -4. The time now is 03:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy