The information of the two files should be redirect to
Third file in such a way that, the third file contain the
information like this.
1st line in third file should be from 1st file
2nd line in Third file should be from 2nd file
3rd line in Third file should be from 1st file
4th line in Third file should be from 2nd file
-
- so on
Answers were Sorted based on User's Feedback
Answer / amol
Unix utility sed can be used serve the purpose
Assuming file1.txt and file2.txt are two input files and
file3.txt is the third file.
Contents of the file1.txt
line 1
line 2
line 3
Contents of the file2.txt
LINE 1
LINE 2
LINE 3
After executing below mentioned command
sed -n -e '{
> R file2.txt
> p
> }' file1.txt > file3.txt
The third file file3.txt will be
line 1
LINE 1
line 2
LINE 2
line 3
LINE 3
| Is This Answer Correct ? | 0 Yes | 3 No |
There are three departments A,B and C.Write a query to display the names of all the persons( in departments other than A) who are paid higher than the person receiving the lowest salary in DEPT A
What is web script?
What does the sh command do?
What is Linux language details
What is the lifespan of a variable inside a shell script?
How to include comments in your shell scripts?
How will you pass and access arguments to a script in linux?
How to handle the delimiter unit seperator in Unix
How do you create a shortcut in linux?
How would you compare the strings in a shell script?
write a shell script to identify the given string is palindrome or not?
17 Answers CTS, HP, IBM, InfoEst, Wipro,
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.