Solved

retrieve nuemaric value from txt file in shell script

Posted on 2016-10-04
3
88 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 500 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

751 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