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

  • Home
  • SEARCH
  • 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 9235493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:03:05+00:00 2026-06-18T07:03:05+00:00

I have a script that modifies all files in a directory and outputs in

  • 0

I have a script that modifies all files in a directory and outputs in terminal the status of the modifications in real time, like this example:

Modifying json.php...   MODIFIED
Modifying layout.php...     ERROR
Modifying a_very_long_named_file.php...     NOT MODIFIED

I’m wondering if there is some command I can use to echo like in an ordered book’s index, like this:

Modifying json.php..........................MODIFIED
Modifying layout.php........................ERROR
Modifying a_very_long_named_file.php........NOT MODIFIED
  • 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-18T07:03:06+00:00Added an answer on June 18, 2026 at 7:03 am

    You can probably do it with echo, put I find printf more satisfying:

    printf "Modifying ...................................\033[11G%s\033[35G%s\n" \
        $filename ERROR
    

    Will print the filename starting at column 11, and print ERROR at column 35,
    with …. in between. If the filename is too large to fit, it will be partially
    overwritten.

    Or:

    If you always have one space after ‘Modifying’, you could try:

    < input column -t | tr ' ' . | sed 's/\./ /'
    

    This requires all of the output to available, so that the maximum width can be determined before any data is produced. Since you say “real time”, that is probably not desirable, in which case you could use something like:

    echo Modifying json.php MODIFIED | perl -lane 'print "$F[0] $F[1]", "...",
        "." x ( 30 - length( $F[1] )), $F[2]'
    

    To print “….” that is 33 columns wide (adjust as desired). If any file name is too long, that row will be too wide, but there’s really no way to determine the maximum width required unless you wait for all of the data to be available. (Unless you have access to all the file names before you start. Pick a suitable width.) The extra "..." is there to have at least some dots printed on wide rows, rather than concatenating the file name with the message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following script that executes all the .reg files in the current directory.
So I have this script that reads the xml, modifies the selected node value
I have this script that run to fix my menu bar to the browser
I have a script that recursively loops through all the sub directories and compresses
I've got a PHP script that checks a directory and deletes any files not
I have a php script that reads an XML file and modifies it with
In my code below, I have a function that asynchronously loads all files necessary
Does anyone have a handy powershell script that gets a set of files from
I have a VSTO solution that has a postbuild event PowerShell script that modifies
I have an upload script that write a index.html file, I modified it to

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.