Sponsored Content
Top Forums Shell Programming and Scripting Print the first line for each multiple lines Post 302897260 by redse171 on Saturday 12th of April 2014 12:34:50 PM
Old 04-12-2014
Hi MadeInGermany,

Thanks a lot! It works flawlessly Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare multiple fields in file1 to file2 and print line and next line

Hello, I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions 1. file1 is only a few thousand lines at most and file2 is greater than 2 million 2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies

2. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

3. Shell Programming and Scripting

(awk?) print multiple lines on one line

I have a log file something like ------- report 1 ------- date 27/01/13 time 08:00 records 1234 ------- report 2------- date 27/01/13 time 08:00 records 1239 ... I'd like output to show as report 1,date 27/01/13,time 08:00,records 1234 report 2,date 27/01/13,time... (6 Replies)
Discussion started by: gefa
6 Replies

4. Shell Programming and Scripting

String search and print next all lines in one line until blank line

Dear all I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under. i/p file: A1/EXT "BSCABD1_21233G1" 757 130823 1157 RADIO X-CEIVER ADMINISTRATION BTS EXTERNAL FAULT ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

5. Shell Programming and Scripting

Echo printing a line in 2 lines; expected to print in one line

Dear All, fileName: therm.txt nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41 1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2 -2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3 ... (7 Replies)
Discussion started by: linuxUser_
7 Replies

6. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

7. Shell Programming and Scripting

Print multiple lines on one line

Hi All, I have a file looks like: rst:singh:99.0.20-X86 2 rst:ACSI_SIN_SERVICES rst:singh:99.0.20-X86 2 rst:ACSI_BISI want to wrap 3rd col in one line and add variable value at start and ending of line and I wrote command: cat file | awk '{print $3}' | xargs > command.txt sed -e... (1 Reply)
Discussion started by: rakeshtomar82
1 Replies

8. Shell Programming and Scripting

How to print different multiple lines after two patterns?

Hello, I need to print some lines as explained below, TXT example 1111 2222 3333 4444 5555 6666 7777 8888 6666 9999 1111 2222 3333 4444 5555 (8 Replies)
Discussion started by: liuzhencc
8 Replies

9. Shell Programming and Scripting

How to print previous line of multiple pattern matched line?

Hello, I have below format log file, Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies

10. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 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 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy