I want a simple Java application which will work like linux grep
command, also take input from pipeline.
Thanks
1st U have to check for command line args
if avail more than 2 arguments
then, 1st one is radix and 2nd one is file name read file line by line, match the radix string, and print it
if command line is only 1 argument
then you should check for System.in
which comes from pipeline read line by line and check that single arg String as radix and print it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.