Jack 10 J 10 A 20 Lu cal 20 A bc U 20
I want to get the sum of these nums: 10+10+20+20+20 = 80
but I can’t use cat input|cut -d " " -f 3 to get the num, how can I do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use grep + paste + bc
instead grep, you can use cut
or just awk
BUT if you can use awk, you can sum using awk