Sponsored Content
Full Discussion: Copying Contents of a file
Top Forums UNIX for Beginners Questions & Answers Copying Contents of a file Post 303016509 by 2metal4u on Friday 27th of April 2018 09:56:49 PM
Old 04-27-2018
Copying Contents of a file

Hello all. Is there a command to copy the contents of one file into another file as the first line?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating file contents using contents of another file

Hi, I am not sure how to start doing this so I hope to get some advice as to how to start. I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format: "CONTINENT","COUNTRY","CITY","ID" "asia","japan","tokyo","123"... (21 Replies)
Discussion started by: ReV
21 Replies

2. Shell Programming and Scripting

Compress the contents of a directory while copying data into it

Hi guys I have a need to compress the contents of a directory while I am copying data into it. I was able to do this when it was only one file by doing as below: STEP1: mknod myfile p STEP2: chmod 777 myfile STEP3: compress -v < myfile > myfile.Z & STEP4: cp -p xyz_file myfile... (2 Replies)
Discussion started by: user1602
2 Replies

3. UNIX for Dummies Questions & Answers

compare 2 file contents , if same delete 2nd file contents

Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents..... I try with "diff"...... but confusion how to use "diff" with if ---else Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies

4. Shell Programming and Scripting

sed command for copying the contents of other file replacing it another file on specifc pattern

We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>" FILE1.XML 1. <itemList> 2. <item type="Manufactured"> 3. <resourceCode>431048</resourceCode> 4. ... (0 Replies)
Discussion started by: balrajg
0 Replies

5. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

6. Shell Programming and Scripting

I want to delete the contents of a file which are matching with contents of other file

Hi, I want to delete the contents of a file which are matching with contents of other file in shell scripting. Ex. file1 sheel,sumit,1,2,3,4,5,6,7,8 sumit,rana,2,3,4,5,6,7,8,9 grade,pass,2,3,4,5,6,232,1,1 name,sur,33,1,4,12,3,5,6,8 sheel,pass,2,3,4,5,6,232,1,1 File2... (3 Replies)
Discussion started by: ranasheel2000
3 Replies

7. Shell Programming and Scripting

Replace partial contents of file with contents read from other file

Hi, I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file. i am able to... (2 Replies)
Discussion started by: seeki
2 Replies

8. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

9. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

10. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
volcopy(1M)															       volcopy(1M)

NAME
volcopy, labelit - copy a file system with label checking SYNOPSIS
[options] fsname special1 volname1 special2 volname2 [options] special [fsname volume DESCRIPTION
The command makes a literal copy of the file system using a block size matched to the device. Options recognizes the following options: Specify the file system type on which to operate (see fstyp(1M) and fs_wrapper(5)). If this option is not included on the command line, then the file system type is determined from the file by matching special with an entry in that file. If there is no entry in then the file sys- tem type is determined from the file Invoke a verification sequence requiring a positive operator response instead of the standard delay before the copy is made. Specify options specific to the file system type. specific_options is a list of suboptions and/or keyword/attribute pairs intended for an FStype-specific module of the command. See the file system specific manual entries for a description of the specific_options that are supported, if any. (default) Invoke the DEL-if-wrong verification sequence. Assume a response to all questions Echo the completed command line, but perform no other actions. The command line is generated by incorporating the user-specified options and arguments with other information derived from This option allows the user to verify the command line. Other options are used with 9-track magnetic tapes: Bits per inch. Size of reel in feet. Beginning reel number for a restarted copy. Use double buffered I/O. The command requests length and density information if they are not given on the command line and they are not recorded on an input tape label. If the file system is too large to fit on one reel, the command prompts for additional reels. Labels of all reels are checked. Tapes can be mounted alternately on two or more drives. If the command is interrupted, it asks if the user wants to quit or wants to escape to the command interpreter. In the latter case, other operations (such as executing the command) can be performed before returning to the command by exiting the command interpreter. fsname The file system name on the device (e.g., being copied. special The physical disk section or tape (e.g., or volname The physical volume name; it should match the external sticker. Such label names are limited to six or fewer characters. The argument volname can be to use the existing volume name. special1 The device from which the copy of the file system is being extracted. volname1 The volume from which the copy of the file system is being extracted. special2 The target device. volname2 The target volume. The command can be used to provide initial labels for unmounted disk or tape file systems. With the optional arguments omitted, the com- mand prints current label values. The option provides for initial labeling of new tapes only (this destroys previous contents). The and options can be specified for the command. The behavior of the and options is similar to their behavior in the command. FILES
File that specifies the default file system type. Static information about the file systems. SEE ALSO
volcopy_hfs(1M), fs_wrapper(5), disk(7), mt(7). volcopy(1M)
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy