Sponsored Content
Top Forums Shell Programming and Scripting For loop to get rid of first 2 lines(conditionally) Post 302936571 by crazy_max on Thursday 26th of February 2015 12:03:26 PM
Old 02-26-2015
okay that worked, sorry i was looking at wrong file i guess. didnt realized that it created a new file....

is there a way to do the same without creating a new file ?...just use the same file and also could you please explain what exactly is the below doing ?

'/headers/{p=1;next}p'
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get rid of first & last lines from STD_OUT

I have an application that executes, printing a bunch of text to the screen... only problem is that I don't want to see the first line (the internal command being run) or the last line (it says "done") is there something to chop off the first and last line simply through use of piping the... (2 Replies)
Discussion started by: jjinno
2 Replies

2. UNIX for Dummies Questions & Answers

Conditionally joining lines in vi

I've done this before but I can't remember how. Too long away from vi. I want to do a search are replace, but I want the replace to be a join. Example see spot run see spot walk see spot run fast see spot hop %s/run$/<somehow perform a join with the next line>/g so the results... (0 Replies)
Discussion started by: ifermon
0 Replies

3. Shell Programming and Scripting

How to get different lines using a for loop

Hi I am trying to write a small AWK program to extract 324 lines which have a pattern in the line numbers. For examples, I want to extract lines 2, 5, 7, 11 and lines like (2+662), (5+662), (7+662), (11+662) and (2+662+662), (5+662+662), (7+662+662), (11+662+662) and so on for 27 times from... (5 Replies)
Discussion started by: ananyob
5 Replies

4. Shell Programming and Scripting

Conditionally delete last X lines

delete last X lines,which start with + example file: test1 test2 remove1 remove2 one liner shell is preferred. (8 Replies)
Discussion started by: honglus
8 Replies

5. Shell Programming and Scripting

Loop through file to sum conditionally

Hi, I have a file with header, detail and trailer records. HDR|111 DTL|abc|100|xyz DTL|abc|50|xyz TRL|150 I need to add the values in 3rd field from DTL records. Using awk, I am doing it as follows: awk -F'|' '$1=="DTL"{a += $3} END {print a}' <source_file> However, I want to... (3 Replies)
Discussion started by: delta21
3 Replies

6. Shell Programming and Scripting

sed to conditionally delete multiple lines

Hello I'd like to remove any line in an output file that is preceded by one or more warning messages (each warning is on a separate line). Example : WARNING: Estimation of lower confidence limit of \rho failed; setting it to 0. 822 28447 ... (4 Replies)
Discussion started by: jossojjos
4 Replies

7. Shell Programming and Scripting

Reading two lines in a while loop and combining the lines

Dear all, I have a file like this: imput scaffold_0 1 scaffold_0 10000 scaffold_0 20000 scaffold_0 25000 scaffold_1 1 scaffold_1 10000 scaffold_1 20000 scaffold_1 23283 and I want the output like this: scaffold_0 1 scaffold_0 10000 scaffold_0 10000 scaffold_0 20000... (6 Replies)
Discussion started by: valente
6 Replies

8. Shell Programming and Scripting

get rid of unwanted lines

Hi , My output contains the below contents When i execute df -h | grep / | grep -v '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' i get output as below tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/WebArch.vbs 1.7T 1.3T 452G 74% /vob/WebArch... (6 Replies)
Discussion started by: ptappeta
6 Replies

9. Shell Programming and Scripting

Picking up files conditionally

Hi I have a scenario: I have a directory say DIR1 (no sub directories) and have few files in that directory as given below: app-cnd-imp-20150820.txt app-cxyzm-imp-20150820.txt app-petco-imp-20150820.txt app-mobility-imp-20150820.txt app-mobility-imp-20150821.txt... (7 Replies)
Discussion started by: Saanvi1
7 Replies

10. Web Development

Getting Rid of Annoying Bootstrap Table Borders and Wayward Table Lines

Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer: <script> $(function(){ $('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies
XtManageChildren()														XtManageChildren()

Name
  XtManageChildren - bring an array of widgets under their parent's geometry management.

Synopsis
     void XtManageChildren(children, num_children)
	 WidgetList children;
	 Cardinal num_children;

Inputs
  children    Specifies an array of child widgets.  The widgets must all be siblings and must be of class RectObj or any subclass thereof.

  num_children
	      Specifies the number of children in the array.

Description
  XtManageChildren()  brings  a  list  of  widgets  created with XtCreateWidget() under the geometry management of their parent.  All widgets
  (except shell widgets) must be managed  in  order  to  be  visible.	Managing  a  widget  will  generally  make  it	visible,  unless  its
  XtNmappedWhenManaged resource is False.

  The "Algorithm" section below details the procedure followed by XtManageChildren().

Usage
  To manage a single widget, you can use XtManageChild().  To unmanage widgets, use XtUnmanageChild() and XtUnmanageChildren().

  If  you  are going to manage multiple children of the same managed and realized parent, it is more efficient to place those children widget
  into an array and call XtManageChildren() just once than it is to manage them individually.  The former technique results in only a  single
  call to the parent's change_managed() method.  If you are creating widgets before the widget tree has been realized, however, managing them
  one at a time is fine.

Algorithm
  XtManageChildren() performs the following:

  o  Issues an error if the children do not all have the same parent or if the parent is not a subclass of compositeWidgetClass.

  o  Returns immediately if the common parent is being destroyed; otherwise, for each unique child on the  list,  XtManageChildren()  ignores
     the child if it already is managed or is being destroyed, and marks it otherwise.

  o  If the parent is realized XtManageChildren() does the following:

     -	Calls the change_managed() method of the widgets' parent.

     -	Calls XtRealizeWidget() on each marked child that is unrealized.

     -	Maps each marked child that has its XtNmappedWhenManaged resource True.

  The  management of children is independent of the creation and ordering of the children.  There is no special list of managed children; the
  layout routine of the parent should loop through the list of all children and simply ignore those that are not managed (see XtIsManaged()).

Structures
     typedef Widget *WidgetList;

See Also
  XtCreateManagedWidget(1),  XtIsManaged(1),  XtManageChild(1),  XtMoveWidget(1),  XtRealizeWidget(1),	XtSetMappedWhenManaged(1),   XtUnman-
  ageChild(1), XtUnmanageChildren(1).

Xt - Widget Lifecycle														XtManageChildren()
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy