hello,
I need help in Unix scripting
I have a whole list of file name in a Input file. I need to run the command iteratively and output the result into a text file
e.g
While read < Input file ; do
QUERY filenane
done > output.txt
Appreciate your help
Thank you
Suhas;)
rdrtx1
September 19, 2012, 4:31pm
2
#/bin/sh
while read filename
do
echo run process "\"$filename\""
done < infile > outfile
You're already pretty close.
while read FILENAME
do
echo "do something with $FILENAME"
done < inputfile > outputfile
I am getting the data I want
This what I want
Command QUERY filename
----output from above command---
filename is an index file (bit-mapped)
Dictionary segment not allocated
File can contain 62,914,560 records
your solution gives
QUERY "filename1
"
QUERY "filename2
"
---------- Post updated at 01:46 PM ---------- Previous update was at 01:42 PM ----------
I am not getting the solution.
This what I want
Command QUERY filename
----output from above command---
filename is an index file (bit-mapped)
Dictionary segment not allocated
File can contain 62,914,560 records
your solution gives
QUERY "filename1
"
QUERY "filename2
"
---------- Post updated 09-20-12 at 08:10 AM ---------- Previous update was 09-19-12 at 01:46 PM ----------
How do I rectify the error ?
The file exists.
bash-3.00$ echo `QUERY ` "ACTION"
usage: QUERY file ...
ACTION
while read FILENAME
do
QUERY "$FILENAME"
done < inputfile > outputfile
QUERY: can't open filename 1
QUERY: can't open filename 2
I
---------- Post updated at 08:45 AM ---------- Previous update was at 08:21 AM ----------
This also did not work
#/bin/sh
while read filename
do
echo `QUERY ` "$filename"
done < ~/Test.txt > ~/outfile
---------- Post updated at 08:46 AM ---------- Previous update was at 08:45 AM ----------
QUERY is a program and its input is a filename
Please read and copy well.
I haven't used back-ticks. Why have you?
Use QUERY "$filename"
instead of echo `QUERY ` "$filename"
.
Because I used your solution and did not get the result I wanted
your solution gives
QUERY "filename1
"
QUERY "filename2
"
Can you post a sample of your input file?