Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:51:26+00:00 2026-06-13T05:51:26+00:00

My script is reading an input file row by row from start to end

  • 0

My script is reading an input file row by row from start to end in a WHILE loop.

Lets say there is 100 rows in the input file.

when I will run the script, say script.ksh

It should show, 1 % completed, when 1 row is read from the input file.
2 % completed, when 2 rows are read from the input file.
and show on…

I want to show the percent completion bar from 1 to 100, in a single line output, not in 100 lines.

100 % completed. when the script ran successfully.

$value % completed.

here, $value should change from 1 to 100 as per the progress in a single line.

Example:

in file ipfile.txt, I have
1
2
3
4
.
.
upto
100

count=1
while read line
do
.......
.......
count=`expr $count + 1`
done<ipfile.txt

Here $count value will change from 1 to100.
when I will run the script,
output:
1 % completed. when $count=1
2 % completed. when $count=2
and show on upto 100 %.This completion status should be in single line output.

Hope my requirement is clear, let me know if it’s need any more explanations.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:51:27+00:00Added an answer on June 13, 2026 at 5:51 am
    line_num = 1
    while read line; do
        printf "$((line_num++))%% completed\r";
        ...
    done < input-file
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error while accessing a php script: W/System.err: Error reading from ./org/apache/harmony/awt/www/content/text/html.class
I have a perl script that's reading an INI file like this: [placeholder_title] Hostname
am reading out of a database with the following python script: cur.execute(SELECT * FROM
I have a small script that reads a file. After reading a line i'm
I was reading this http://dev.w3.org/html5/markup/input.file.html , but I only found the accept attribute. I
I am reading a text file . and then splitting it into by 100
Given input, which shows tag assignments to images, as follows (reading this from php://stdin
The problem I have is reading in multiple lines of integers from a file
This can certainly be done using a simple script and reading the database. I
I'm currently working on a PowerShell script to analyse VPN traffic by reading the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.