how to separate the even and odd number generated from one
file to two separate file i.e. even numbers in file1.txt and
odd numbers in file2.txt
Answer Posted / jaya prasad
echo "Enter the file name"
read file
awk '$NF % 2 == 0' $file > file1.txt
awk '$NF % 2 != 0' $file > file2.txt
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
What are the different types of variables used in shell script?
Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?
How do I stop script errors?
Explain about return code?
What are the zombie processes?
How do I run a shell script in powershell?
What lives in a shell?
Why is a script important?
How to calculate the number of passed arguments?
Is shell scripting easy to learn?
How can I set the default rwx permission to all users on every file which is created in the current shell?
What is a shell script in windows?
What is sh in shell script?
What does $1 mean in bash?
What is shell geeksforgeeks?