Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

retrieve nuemaric value from txt file in shell script

Posted on 2016-10-04
3
Medium Priority
?
112 Views
Last Modified: 2016-10-05
below content has been written in a text file called test.txt. How to retrieve pending  & completed count value in shell script?

<p class="pending">Count: 0</p>
<p class="success">Count: 0</p>
<p class="completed">Jobs completed today: 0</p>

#!/bin/bash

echo
echo 'Fetching job page and write to ZipJobs.txt file...'
curl -o Jobs.txt https://cms.test.com/test

status=`grep "Jobs completed today" /home/Jobs.txt | ???
echo $status
0
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41828205
cut -d":" -f2 | cut -d"<" -f1`
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 41829257
Gerwin,

can you please expalin what is cut command & f2 & f1??
0
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 2000 total points
ID: 41829298
cut is cutting text into pieces, with -d you set the separator and with -f you select the field(s) to print.  put the above in place of your???
0

Featured Post

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question