Command line tool- read from file

Posted on 2006-05-23
Last Modified: 2010-04-22
I am not sure if this is the right category to post this question.

Lets say I am running a tool from the command line:


And I need to follow it with text..

./testtool -d asdfalskdjfalskdfjlaksjdflkajsldfjlasdklfjls

However, I would like the tool to process the text I currently have in a file.

How would I go about doing this?
Question by:jewee
    LVL 45

    Expert Comment

    Hi jewee,

    You could pass the filename as argument ... Incase you do not have control over working of the tool, you can pass the normal options and redirect input by using < operator

    ./testtool -d asasddfdf < inputfile

    LVL 84

    Accepted Solution

    ./testtool -d `cat file`
    LVL 84

    Assisted Solution

    while read text
     ./testtool -d $text
    done < file

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now