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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:22:09+00:00 2026-05-28T02:22:09+00:00

I know the Linux command paste can be used to combine two lines in

  • 0

I know the Linux command paste can be used to combine two lines in two files. My question is how can I add some other string inside them?

For example, I have 2 files:

[root@localhost ~]# cat c1
aaaa
bbbbbbbbbbbbb
[root@localhost ~]# cat c2
11111111
222222222222
[root@localhost ~]# 
[root@localhost ~]# paste c1 c2
aaaa    11111111
bbbbbbbbbbbbb   222222222222
[root@localhost ~]# 

How can I insert text between them, for example, how can I get the following result?

var aaaa = some_function(11111111);
var bbbbbbbbbbbbb = some_function(222222222222);

Can this be implemented by the paste command? 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-05-28T02:22:10+00:00Added an answer on May 28, 2026 at 2:22 am

    Maybe there’s a way to do this with paste, but it can certainly be done easily with awk:

    paste c1 c2 | awk '{ printf("var %s = some_function(%s);\n", $1, $2); }'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In linux, I know with 'ps' you can get the arguments that a command
Does anyone know of a linux-compatible command line html formatter? You know, something where
I would like to know exactly how the Is command works in Linux and
Anyone know of a command-line CSV viewer for Linux/OS X? I'm thinking of something
Is there a command line program for linux (ubuntu) which can generate a large
I wanted to know if I could just use Linux command 'dd' to make
In some versions of UNIX and Linux there's a banner command (usually /usr/bin/banner) that
Is it possible to know the current quarter using Linux command line? I didn't
I know we can adjust scheduling priority by using the nice command. However, the
I'm using mac/linux and I know that ctrl-z stops the currently running command in

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.