Sponsored Content
Top Forums Shell Programming and Scripting Replicating certain lines in a textfile Post 302942560 by RudiC on Wednesday 29th of April 2015 04:05:01 PM
Old 04-29-2015
X=X $0 "\n"; is a concatenation of X plus $0 plus \n, then assigned to X.

That external for loop will of course print the entire file REPEAT times. If your entire problem were known, it possibly might be solvable entirely in awk.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

replicating restricted sam users

I'm in the process of setting up two new HP-UX 11.23 i64 servers. On my existing server (HP-UX B.11.0) we have several users defined to have restricted sam access. I'm having trouble finding those definitions and copying them over to the new servers. Is this possible - to just copy over the... (1 Reply)
Discussion started by: LisaS
1 Replies

2. AIX

Command for replicating a directory

Morning all, Is there a command on AIX that can replicate/synchronise two directories? I'm after functionality similar to robocopy on Windows. Scenario: I have a directory of Oracle forms for my production system and one for my dev system, these directories start off identical. The forms... (1 Reply)
Discussion started by: huggie
1 Replies

3. Shell Programming and Scripting

How to delete all lines with less then 32 characters from a textfile?

I need to delete all lines with less then 32 characters from a textfile. :) (15 Replies)
Discussion started by: anna428
15 Replies

4. Shell Programming and Scripting

Find a string in textfile, erase $num lines after that string

I have a textfile containing text similar to the following pattern: STRING1 UNIQUE_STRING1 STRING2 STRING3 STRING4 STRING5 STRING1 UNIQUE_STRING2 STRING2 STRING3 STRING4 STRING5 STRING1 UNIQUE_STRING3 STRING2 STRING3 (6 Replies)
Discussion started by: ilcsfe
6 Replies

5. UNIX for Dummies Questions & Answers

Replicating many rows in unix

Hi If my input is abcdefgh ijklmnop then the output should be: abcdefgh abcdefgh abcdefgh abcdefgh ijklmnop (6 Replies)
Discussion started by: pandeesh
6 Replies

6. UNIX for Dummies Questions & Answers

Replicating content using sed

if we want to replicate the content of the file twice, then we can use sed 'p' filename In the same way, if i want to replicate the content thrice or 4 times, how we can achieve in SED? Thanks (5 Replies)
Discussion started by: pandeesh
5 Replies

7. Shell Programming and Scripting

Replicating jobs, renaming outout

Can anyone tell me if it's possible to write a script that will repeat the same job several times but give the output a slightly different name each time (i.e. change or add a number at the end of the output file)? Here is the script I use to run a single job: #!/bin/bash #PBS -N job0 #PBS -l... (1 Reply)
Discussion started by: peterjb100
1 Replies

8. Shell Programming and Scripting

Cut lines from and to in a textfile

i am having a text file like below rama surya pandu latha singh raja i want to get the new file from 3 to 5 i.e pandu latha singh please help (1 Reply)
Discussion started by: suryanarayana
1 Replies

9. Shell Programming and Scripting

How to separate sorte different characters from one textfile and copy them in a new textfile?

My first post, so don't kill me :) Say i open some textfile with some example like this. on the table are handy, bread and wine Now i know exactly what is in and i want to separate and sorted it in terminal to an existing file with another 2 existing lines in like this: table plane ... (3 Replies)
Discussion started by: schwatter
3 Replies

10. UNIX for Advanced & Expert Users

Glusterfs not replicating

0 down vote favorite I have replicated glusterfs on two servers, if i create file on one server it doesnt reflect on other, if i try to heal the volume on node2 i get this error Commit failed on node2. Please check log file for details. glustershd.log E 0-test-client-3: connection to... (0 Replies)
Discussion started by: davidbob
0 Replies
Net::SIP::Dispatcher::Eventloop(3pm)			User Contributed Perl Documentation		      Net::SIP::Dispatcher::Eventloop(3pm)

NAME
Net::SIP::Dispatcher::Eventloop - simple event loop for Net::SIP::Dispatcher SYNOPSIS
my $loop = Net::SIP::Dispatcher::Eventloop->new; $loop->addFD( $fd, $callback ); $loop->add_timer( 10,$callback ); $loop->loop; DESCRIPTION
The package implements a simple event loop. It's not optimized for speed but it is provided as a simple implementation in case the users application does not has an event loop yet. Because the eventloop object can be given in the constructor of Net::SIP::Dispatcher you might provide an alternative implementation, which implemented the described methods. CONSTRUCTOR
new Creates new event loop, returns created object METHODS
addFD ( HANDLE, CALLBACK, ?NAME ) Adds file handle HANDLE to the event loop, so that CALLBACK gets triggered if HANDLE is readable. CALLBACK is a callback accepted by invoke_callback in Net::SIP::Util. The callback will be invoked with HANDLE as an additional argument. NAME can be used to aid debugging, it will be shown in the debug messages once the FD gets ready. If there was already a callback for HANDLE it gets replaced by the new one. IMPORTANT NOTE: CALLBACK gets triggered if HANDLE *is* readable inside the loop, not if HANDLE *gets* readable. Unlike with Event::Lib or similar the CALLBACK is not triggered by the edge, but by the level (like poll(2) or select(2)). So if 2 bytes come in at the handle and one reads only 1 byte in the callback the callback gets triggered again for more data. You have to watch this, if you want to integrate Net::SIP with your existing event loop. delFD ( HANDLE ) Removes HANDLE from loop, e.g. no more checking for readability will be done. add_timer( WHEN, CALLBACK, [ REPEAT ] ) Adds timer which gets triggered at WHEN or "now + WHEN". Depending on the value of WHEN it gets interpreted as the number of seconds since 1970-01-01 (when it's really big) or as a relative time (when it's not that big). WHEN can be floating point for subseconds resolution. CALLBACK is a callback accepted by invoke_callback in Net::SIP::Util. It gets invoked with the timer object (see later) as an additional argument, which has a method cancel for canceling the (repeating) timer. REPEAT is the number of seconds between each invocation of the timer. If greater then 0 (subsection resulution possible) the callback will be called each REPEAT seconds, after it was called the first time at WHEN. The method will return an object which has a method cancel which can be used to cancel the timer before it gets triggered (or gets triggered the next time in case of repeating timers). looptime Returns the current loop time in subseconds resolution (using gettimeofday from Time::HiRes). This is not the current time, but the time, when the last event in the loop occured (e.g. when the select(2) call returned) loop ( [ TIMEOUT, @STOPVAR ] ) The main loop, e.g. continuiosly checks timers and file handles for the events and calls callbacks. If TIMEOUT is given it will run the loop for at most TIMEOUT seconds, then the method will return. Undefined TIMEOUT means that it will never return because of timeout and TIMEOUT of 0 means that it will check all timers and handles only once and then return. @STOPVAR is a list of scalar references. These scalars are expected to be changed from the callbacks, so it will check after each loop cycle, e.g. after all callbacks are called (timers and handles) if any of these scalars is TRUE, in which case it will end the loop. The behavior with STOPVAR cannot be found in most existing event loops. If you want to integrate Net::SIP with your own event loop you migth simply wrap all callbacks given in addFD and add_timer in another callback which at the end checks the stopvars and terminates the 3rd-party loop in a loop-specific way. perl v5.14.2 2009-01-23 Net::SIP::Dispatcher::Eventloop(3pm)
All times are GMT -4. The time now is 05:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy