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


Please Help Members By Posting Answers For Below Questions

What is bash coding?

507


When should shell programming/scripting not be used?

604


What are the advantages of using shell scripts?

593


What makes c shell a more preferable option than the bourne shell?

546


Which scripting language is best for automation?

540






Is shell scripting a programming language?

585


determine the output of the following command: echo ${new:-variable}

557


Is shell a scripting language?

578


What is the best scripting language?

574


What is mac default shell?

623


What is scripting used for?

575


What language is used in terminal?

566


Where is bash history?

511


What language is bash written in?

569


How will you pass and access arguments to a script in linux?

600