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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:57:48+00:00 2026-05-22T16:57:48+00:00

Is there similar Python zip() functionailty in bash? To be specific, I’m looking for

  • 0

Is there similar Python zip() functionailty in bash? To be specific, I’m looking for the equivilent functionality in bash without using python:

$ echo "A" > test_a
$ echo "B" >> test_a
$ echo "1" > test_b
$ echo "2" >> test_b
$ python -c "print '\n'.join([' '.join([a.strip(),b.strip()]) for a,b in zip(open('test_a'),open('test_b'))])"
A 1
B 2
  • 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-05-22T16:57:49+00:00Added an answer on May 22, 2026 at 4:57 pm

    Pure bash:

    liori@marvin:~$ zip34() { while read word3 <&3; do read word4 <&4 ; echo $word3 $word4 ; done }
    liori@marvin:~$ zip34 3<a 4<b
    alpha one
    beta two
    gamma three
    delta four
    epsilon five
    liori@marvin:~$
    

    (old answer) Look at join.

    liori:~% cat a
    alpha
    beta
    gamma
    delta
    epsilon
    liori:~% cat b
    one
    two
    three
    four
    five
    liori:~% join =(cat -n a) =(cat -n b)
    1 alpha one
    2 beta two
    3 gamma three
    4 delta four
    5 epsilon five
    

    (assuming you’ve got the =() operator like in zsh, otherwise it’s more complicated).

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

Sidebar

Related Questions

Is there similar component for Delphi like dictionary of Python? I'm now using TStringList
is there similar syntax to php's $$variable in python? what I am actually trying
is there a similar function in python that takes search(array) and replace(array) as a
In python we can use multiprocessing modules. If there is a similar library in
Does anyone know if there is a c# Console app, similar to the Python
Is there a way in Python to handle XML files similar to the way
Is there any GUI toolkit for Python with form designer similar to Delphi, eg
I have used getopt in Python and was hoping there would be something similar
Is there something similar in PHP to the try ... else in Python? I
I am looking for a way to define properties in Python similar to C#,

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.