ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hello
I am looking to do this with same command approach I have two files i just want to gerp the last vaule in the line which is the number if is there or show unknown if does not
file1
Code:
114444444,2,FTTH,DTN,No Dial tone & No Browsing,FBR,Fiber Major Fault,11-444-4444
112221111,2,FTTH,CCO,Can't call some lines,ERR,Err Opening TT#,11-222-1111
DTN,No Dial tone & No Browsing,FBR,Fiber Major Fault,CCO,Can't call some lines,ERR,Err Opening TT#,"116-00_MRSTR8888L9:1-1-11-111 116-00_MRSTRD1111 11-222-1111
I am looking to have this output
Code:
DTN,No Dial tone & No Browsing,FBR,Fiber Major Fault,unknown
CCO,Can't call some lines,ERR,Err Opening TT#,"116-00_MRSTRD00OL9:1-1-12-4-12 116-00_MRSTRD1111 11-222-1111
just I want to grep 11-222-1111 from file1 also some field should be appear from file 1
Code:
DTN,No Dial tone & No Browsing,FBR,Fiber Major Fault,unknown
CCO,Can't call some lines,ERR,Err Opening TT#,"116-00_MRSTRD00OL9:1-1-12-4-12 116-00_MRSTRD1111 11-222-1111
awk has done all the heavy lifting so you would need to explain what you mean by trace? What to you is the use of the bash while loop? Especially after pan64 has explained that your current pasting together of multiple commands is a poor way to proceed.
awk has a built-in while loop. I would suggest you to go thru that script and try to understand it. Use the man page of awk and ask if something is not clear...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.