Sponsored Content
Top Forums Shell Programming and Scripting Insert content of a file to another file at a line number which is given by third file Post 302982449 by RudiC on Thursday 29th of September 2016 05:58:50 AM
Old 09-29-2016
Try also
Code:
awk 'NR == 1 {LC = $0; next} FNR == LC {while (0 < getline X < FI) print X} 1' file3 FI="file2" file1
unix is best 
unix is best 
linux is best
unix is best
linux is best
Windows performs better
Mac OS performs better
Windows performs better
Mac OS performs better
linux is best
unix is best
unix is best

These 2 Users Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract content from a file and insert to another file

please help for the following task... I have to extract the mac address & IP address from the file1: ... 0100004512EEF4 03 192.168.0.7 192.168.0.1 -1 ... 0100779hF5D212 03 192.168.0.8 192.168.0.1 -1 ... 0100789lF5D212 03 192.168.0.9 192.168.0.1 -1 ... ... change the format (addidng... (15 Replies)
Discussion started by: fredao
15 Replies

2. Shell Programming and Scripting

Insert content of a file after a certain line in another file

Hi, it's my first post to this forum. I just started bash and I'm stuck at one issue. I want to include content of a file in another file after a certain line. I'm using sed for inserting one line but how to insert all content of a file ? For example i have a file list.txt with a few lines and... (4 Replies)
Discussion started by: ktm
4 Replies

3. Shell Programming and Scripting

Insert output into file at line number

I need to insert the output of a script into a specific line number of a txt file. I've read the Sed man page and searched the forums and it's not immediately clear how I would go about doing this. (4 Replies)
Discussion started by: pluto7777
4 Replies

4. Shell Programming and Scripting

move contents from one file to another based on line number or content

I want a script that will move everything beyond a certain line number or beyond a certain content word into another file. For example, if file A has this: first line second line third line forth line fifth line sixth line I want to run a script that will move everything beyond the third... (4 Replies)
Discussion started by: robp2175
4 Replies

5. Shell Programming and Scripting

Insert content of a file into another file before given pattern

I need to insert file x2 into x1 right before first BBB line. $ cat x1 AAA 1 AAA 2 AAA 3 BBB 1 BBB 2 BBB 3 $ cat x2 XXX - insert 1 XXX - insert 2 I need to get AAA 1 AAA 2 AAA 3 XXX - insert 1 XXX - insert 2 BBB 1 (2 Replies)
Discussion started by: migurus
2 Replies

6. Shell Programming and Scripting

Insert content of file before the first occurrence of a line starts with a pattern in another file

Hi all, I'm new to scripting.. facing some problems while inserting content of a file into another file... I want to insert content of a file (file2) into file1, before first occurrence of "line starts with pattern" in file1 file1 ====== working on linux its unix world working on... (14 Replies)
Discussion started by: Jagadeesh Kumar
14 Replies

7. Shell Programming and Scripting

Insert content of a file right after pattern in another file

suppose i have original file: original.txt: hello how are you you are wonderful what time is it I went to the store last night. and some apple juice then i have another file: anotherfile.txt: with my friends mary, john and harry. We had a great time. We bought food Suppose... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. UNIX for Beginners Questions & Answers

Insert content from file 1 to file 2 in specific criteria meet

Hi , I'm looking for some code that can copy and paste form file1 to file2 with 2 criterial meet. file1: test "sp-j1" test "sp-j2" test "sp-j3" test "sp-j4" file2: sub Pre_Shorts1 (Status_Code, Message$) global Status !if Message$ <> "" then print... (3 Replies)
Discussion started by: kttan
3 Replies

9. UNIX for Beginners Questions & Answers

Insert the line number from text file to filename output

Hi everyone :) I have a file "words.txt" containing hundreds of lines of text. Each line contains a slogan. Using the code below i am able to generate an image with the slogan text from each line. The image filename is saved matching the last word on each line. Example: Line 1: We do... (2 Replies)
Discussion started by: martinsmith
2 Replies
UML_SWITCH(1)						      General Commands Manual						     UML_SWITCH(1)

NAME
uml_switch -- switch daemon for user-mode Linux SYNOPSIS
uml_switch [-unix control_socket data_socket] [-hub] [-tap tun device] [-compat-v0] [-daemon] DESCRIPTION
This manual page documents briefly the uml_switch program. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. uml_switch is a daemon for managing a virtual network between user-mode Linux systems, with no connection to the host system's network. It will listen for connections on a pair of UNIX domain sockets, and forward packets between clients which connect to them. OPTIONS
-unix control_socket data_socket Listen on the specified pair of sockets, instead of the defaults. -hub Act like a hub. This means that packets received will be broadcast over all virtual links. The default is to act as a switch, where packets are only sent to the link matching the destination MAC address of the packet. -tap tap device Connect the switch to a dynamically created tap device on the host -compat-v0 Specify control protocol version 0 compatibility. -daemon Run in the background as a daemon. SEE ALSO
linux(1) The UserModeLinux-HOWTO (link to URL http://user-mode-linux.sourceforge.net/UserModeLinux-HOWTO.html) AUTHOR
uml_switch was written by Jeff Dike and others. This manual page was written by Matt Zimmerman mdz@debian.org for the Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. UML_SWITCH(1)
All times are GMT -4. The time now is 02:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy