?
Solved

Command line tool- read from file

Posted on 2006-05-23
3
Medium Priority
?
176 Views
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:

./testtool

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?
0
Comment
Question by:jewee
  • 2
3 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 16744255
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

Cheers!
0
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 16744323
./testtool -d `cat file`
0
 
LVL 85

Assisted Solution

by:ozo
ozo earned 2000 total points
ID: 16744375
while read text
do
 ./testtool -d $text
done < file
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

588 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