Sponsored Content
Full Discussion: duplicating a line
Top Forums UNIX for Dummies Questions & Answers duplicating a line Post 302671197 by millsy5 on Friday 13th of July 2012 08:38:22 AM
Old 07-13-2012
Quote:
Originally Posted by Scrutinizer
Hi, try:
Code:
awk '1; $1==3{print RS s}' s=" 3b ccc ccc ccc" infile

Thanks Scrutinizer, that worked perfectly. Do you mind explaining how it works please.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

duplicating 1st row of data

Hi, I have data in the following format: data1 data2 data3 data4 data5 data6 data7 data8 data9 data10 I require the final output to be: data1 data1 data1 data1 i only require the 1st line but I need to replicate it in n rows where n is the number of rows where data... (4 Replies)
Discussion started by: ReV
4 Replies

2. Post Here to Contact Site Administrators and Moderators

Sorry for duplicating posts

SORRY FOR DUPLICATING POSTS, COULD U JUST REMOVE THE FIRST ONE. Thank u. (1 Reply)
Discussion started by: vrguha
1 Replies

3. HP-UX

duplicating ignite tapes

I have a B180L controller running HP-UX 10.2 with an internal DDS2 tape drive and an external Surestore DDS (24gb) tape drive. I want to make duplicate copies of ignite tapes from one tape drive to another. What is the best way to do this? (1 Reply)
Discussion started by: garyb
1 Replies

4. UNIX for Dummies Questions & Answers

remove duplicating lines

Hi, i have a webserver logfile and want to count how many page views there have been. I was thinking about removing lines that begin with the same user and same date&time, because it indicates they were just looking at one page and multiple hits were counted. My question is how do I do this?... (6 Replies)
Discussion started by: JudithBorg
6 Replies

5. Red Hat

Duplicating ethernet speed

Hi guys, Suppose you have a server with two ethernet cards (1GB each) and each cards are connecting to two different switches cisco 3750. My question is: How can I setup my server's network interfaces to increase the throughput up to 2GB? is it possible? If not, do you know another way to up... (3 Replies)
Discussion started by: iga3725
3 Replies

6. UNIX for Dummies Questions & Answers

Duplicating MAC linux or net?

hi guys I have a IBM eServer BladeCenter HS12 with Linux Red Hat 5.4 installed on it, it is using Bonding. ifcfg-bond0 DEVICE=bond0 BOOTPROTO=none ONBOOT=yes TYPE=Ethernet IPADDR=x.x.x.x NETMASK=x.x.x.x GATEWAY=x.x.x.x USERCTL=no IPV6INIT=no PEERDNS=no BONDING_OPTS="miimon=80... (1 Reply)
Discussion started by: karlochacon
1 Replies

7. Shell Programming and Scripting

mv duplicating directories

Hi Folks, I've put together a script for sorting my backup files into sub folders to be run from a cron job. Each file is named username.tar.gz and the file /etc/trueuserowners contains all users and their owner in the format "user: owner". The script works fine identifying users and their owners... (10 Replies)
Discussion started by: beddo
10 Replies

8. Shell Programming and Scripting

Duplicating and changing sh file

Hello, I have a file named file_1.sh that I want to duplicate into file_2.sh, file_3.sh,..., etc. I also need to change the text within each file so that it would fit the file name. For example, in file_1.sh there is a command to save some output as 'output_1.txt', and also there is an input... (3 Replies)
Discussion started by: haguyw
3 Replies
TAP::Parser::Result::Test(3pm)				User Contributed Perl Documentation			    TAP::Parser::Result::Test(3pm)

NAME
TAP::Parser::Result::Test - Test result token. VERSION
Version 3.25 DESCRIPTION
This is a subclass of TAP::Parser::Result. A token of this class will be returned if a test line is encountered. 1..1 ok 1 - woo hooo! OVERRIDDEN METHODS
This class is the workhorse of the TAP::Parser system. Most TAP lines will be test lines and if "$result->is_test", then you have a bunch of methods at your disposal. Instance Methods "ok" my $ok = $result->ok; Returns the literal text of the "ok" or "not ok" status. "number" my $test_number = $result->number; Returns the number of the test, even if the original TAP output did not supply that number. "description" my $description = $result->description; Returns the description of the test, if any. This is the portion after the test number but before the directive. "directive" my $directive = $result->directive; Returns either "TODO" or "SKIP" if either directive was present for a test line. "explanation" my $explanation = $result->explanation; If a test had either a "TODO" or "SKIP" directive, this method will return the accompanying explanation, if present. not ok 17 - 'Pigs can fly' # TODO not enough acid For the above line, the explanation is not enough acid. "is_ok" if ( $result->is_ok ) { ... } Returns a boolean value indicating whether or not the test passed. Remember that for TODO tests, the test always passes. If the test is unplanned, this method will always return false. See "is_unplanned". "is_actual_ok" if ( $result->is_actual_ok ) { ... } Returns a boolean value indicating whether or not the test passed, regardless of its TODO status. "actual_passed" Deprecated. Please use "is_actual_ok" instead. "todo_passed" if ( $test->todo_passed ) { # test unexpectedly succeeded } If this is a TODO test and an 'ok' line, this method returns true. Otherwise, it will always return false (regardless of passing status on non-todo tests). This is used to track which tests unexpectedly succeeded. "todo_failed" # deprecated in favor of 'todo_passed'. This method was horribly misnamed. This was a badly misnamed method. It indicates which TODO tests unexpectedly succeeded. Will now issue a warning and call "todo_passed". "has_skip" if ( $result->has_skip ) { ... } Returns a boolean value indicating whether or not this test has a SKIP directive. "has_todo" if ( $result->has_todo ) { ... } Returns a boolean value indicating whether or not this test has a TODO directive. "as_string" print $result->as_string; This method prints the test as a string. It will probably be similar, but not necessarily identical, to the original test line. Directives are capitalized, some whitespace may be trimmed and a test number will be added if it was not present in the original line. If you need the original text of the test line, use the "raw" method. "is_unplanned" if ( $test->is_unplanned ) { ... } $test->is_unplanned(1); If a test number is greater than the number of planned tests, this method will return true. Unplanned tests will always return false for "is_ok", regardless of whether or not the test "has_todo". Note that if tests have a trailing plan, it is not possible to set this property for unplanned tests as we do not know it's unplanned until the plan is reached: print <<'END'; ok 1 ok 2 1..1 END perl v5.14.2 2012-06-05 TAP::Parser::Result::Test(3pm)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy