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 67815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:19:09+00:00 2026-05-10T19:19:09+00:00

Attempting to print out a list of values from 2 different variables that are

  • 0

Attempting to print out a list of values from 2 different variables that are aligned correctly.

foreach finalList ($correctList $wrongList) printf '%20s%s\n' $finalList end 

This prints them out an they are aligned, but it’s one after another. How would I have it go through each item in each list and THEN go to a new line?

I want them to eventually appear like this:

Correct    Incorrect Good1      Bad1 Good2      Bad2 Good3      Bad3 

Good comes from correctList Bad comes from wrongList

Getting rid of \n makes it Like this:

Good1     Bad1    Good2    Bad2 

I just want 2 columns.

  • 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. 2026-05-10T19:19:09+00:00Added an answer on May 10, 2026 at 7:19 pm

    You can iterate over both lists at the same time like this:

    # Get the max index of the smallest list set maxIndex = $#correctList if ( $#wrongList < $#correctList ) then   set maxIndex = $#wrongList endif  set index = 1 while ($index <= $maxIndex)   printf '%-20s %s\n' '$correctList[$index]' '$wrongList[$index]'   @ index++ end 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I like using generic types this way. In particular, I… May 11, 2026 at 10:09 am
  • added an answer The short answer is Yes. The long answer is painful.… May 11, 2026 at 10:08 am
  • added an answer As above, try a custom print function like: def my_print(obj):… May 11, 2026 at 10:08 am

Related Questions

Attempting to print out a list of values from 2 different variables that are
I'm attempting to use Mono to load a bitmap and print it on Linux
Attempting to insert an escape character into a table results in a warning. For
Attempting to deploy a MOSS solution to a UAT server from dev server for
When attempting to compile my C# project, I get the following error: 'C:\Documents and
When attempting to call functions in math.h , I'm getting link errors like the
When attempting to understand how a SQL statement is executing, it is sometimes recommended
Does attempting to develop some sort of game, even just as a hobby during
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are
When attempting to open a project from source control on a newly formatted pc,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.