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 / ganeswar bojanapu
#!/bin/bash
echo "Enter a file name"
read file
sed -n '1~2'p $file > oddlines.txt; (or) '1~2p'
sed -n '2~2'p $file > evenlines.txt (or) '2~2p'
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What language is bash written in?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
What is awk in shell scripting?
c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again
What is subshell?
How do I run a .sh file on mac?
What is the equivalent of a file shortcut that we have a window on a linux system?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
What is mac default shell?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
Write a shell script to get current date, time, user name and current working directory.
Differentiate between ‘ and ” quotes.
How to calculate the number of passed arguments?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
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 ?