In a file , how to retrieve the lines which are the
multiples of 50 ? like 50,100,150th lines etc.
Answer Posted / shivu
root@chandru-VirtualBox:~# egrep "^[0-9]*[0|5]0" file
50
100
150
200
250
300
350
400
450
500
501
502
503
504
505
506
507
508
509
550
600
650
700
750
800
850
900
950
1000
But the below one is
root@chandru-VirtualBox:~# egrep "^[0-9][0|5][0]" file
100
150
200
250
300
350
400
450
500
550
600
650
700
750
800
850
900
950
1000
This is also not correct. up to some extend it is ok.
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What is bash command used for?
Why is the use of shell script?
What is meant by dos operating system?
Is scripting and coding the same thing?
What is path in shell script?
Is shell a scripting language?
Give some situations where typing error can destroy a program?
What lives in a shell?
How do I start a shell script?
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
Why do we use shell scripting?
What language is shell scripting?
How can you find out how long the system has been running?
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 ?
Which scripting language is best for automation?