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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:06:40+00:00 2026-06-13T10:06:40+00:00

a newbie to shell programming here. I have this codes so far: prog inputfile

  • 0

a newbie to shell programming here.

I have this codes so far:

prog inputfile outputfile1

sort -rn outputfile1 | cut -f1-2 > outputfile2

My question is there a way to pipe the outputfile directly from the first command to the second to get outputfile2, i.e. skipping the need to create an outputfile1? prog is a custom program that takes inputfile and outpufile names as parameters.

The closest thing I have found is substitution in shell, e.g.

sort <(ls dir)

But it’s not really helpful in this case as I want to pipe the outputfile only and not the stdout.
Thanks for your help!

  • 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-13T10:06:42+00:00Added an answer on June 13, 2026 at 10:06 am

    If I get you right — the opposite:

    prog inputfile >(sort -rn | cut -f1-2 >outputfile)
    

    depending on the prog you may use

    prog inputfile /dev/stdout | sort -rn | cut -f1-2 >outputfile
    

    or even

    prog inputfile - | sort -rn | cut -f1-2 >outputfile
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
Django newbie here. I have two simple models like this: class Fluff(models.Model): # ....
I am newbie to web programming and I have small shell script which basically
newbie here, so thanks in advance for help! I have a Wordpress site with
Newbie question... The objective: I intend to have an HTML text input field as
Newbie question here. I'm in the beginning stages of laying out a site in
Sorry if the question is very straight forward but am a newbie to shell
Newbie question. After I have written the Android App (easy part) I need to
I'm a newbie to Bourne shell and want to do simple array simulation. This
newbie with windows gui programming here. Has Anyone got an idea how to resize

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.