Solved

retrieve nuemaric value from txt file in shell script

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

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…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

615 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