Script to run files with an app


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to run files with an app
# 1  
Old 09-19-2012
Script to run files with an app

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
SuhasSmilie
# 2  
Old 09-19-2012
Code:
 
#/bin/sh
while read filename
do
   echo run process "\"$filename\""
done < infile > outfile

# 3  
Old 09-19-2012
You're already pretty close.

Code:
while read FILENAME
do
        echo "do something with $FILENAME"
done < inputfile > outputfile

# 4  
Old 09-20-2012
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
# 5  
Old 09-20-2012
Code:
while read FILENAME
do
  QUERY "$FILENAME"
done < inputfile > outputfile

# 6  
Old 09-20-2012
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
# 7  
Old 09-20-2012
Please read and copy well.
I haven't used back-ticks. Why have you?
Use QUERY "$filename" instead of echo `QUERY ` "$filename".
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Run script on multiple files

Hi Guys, I've been having a look around to try and understand how i can do the below however havent come across anything that will work. Basically I have a parser script that I need to run across all files in a certain directory, I can do this one my by one on comand line however I... (1 Reply)
Discussion started by: mutley2202
1 Replies

2. Shell Programming and Scripting

Run script on multiple files

I have a script that I need to run on one file at a time. Unfortunately using for i in F* or cat F* is not possible. When I run the script using that, it jumbles the files and they are out of order. Here is the script: gawk '{count++; keyword = $1} END { for (k in count) {if (count == 2)... (18 Replies)
Discussion started by: newbie2010
18 Replies

3. Shell Programming and Scripting

Read files in shell script code and run a C program on those files

HI, I am trying to implement a simple shell script program that does not make use of ls or find commands as they are quite expensive on very large sets of files. So, I am trying to generate the file list myself. What I am trying to do is this: 1. Generate a file name using shell script, for... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

4. Shell Programming and Scripting

Need Mac .sh to run command line app in seperate terminal

Hello, currently we are executing a .sh from terminal. The current .sh looks like this: #!/usr/bin/env bash /Users/user/my.app/Contents/MacOS/my & -- Now, we also need to run a third line in the .sh - It's a command line application that I need to run when I execute the above .sh... (0 Replies)
Discussion started by: yoyoyo777
0 Replies

5. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

6. UNIX for Advanced & Expert Users

run win app on Linux -performance issue

We develop software for diagnostic tools for cars. we a use a portable PC(x86) runs Win98 to run our applications. Hence the working environment in the company is Windows, specifically we use BASIC to develop the GUI, communication functions, DLL, etc. and run them on the Win98 PC. We suggested... (1 Reply)
Discussion started by: raedbenz
1 Replies

7. Shell Programming and Scripting

unable to run mono app using .sh script

I did a search for this problem but couldn't find any specific answers to my problem. We have a .NET application compiled in SharpDevelop for Mono which we want to execute with a .sh shell script on Ubuntu. When we execute the script nothing happens meaning the application's visual interface... (0 Replies)
Discussion started by: JacquesB
0 Replies

8. Shell Programming and Scripting

Script to do a function on all files in one run

Hello everybody I am trying to write a script in Cshell solaris 8 to read a number of files and do some commands on them (for example extracting some information) and send the results to one single file. I want to do that for all the files in one run. Could any body advise me on it. Thanks and... (5 Replies)
Discussion started by: Reza Nazarian
5 Replies

9. UNIX for Dummies Questions & Answers

how to run app in BSD under OS X

Hi, I have a problem running application in BSD in os x. I want to run a app called "iCab", so i type "./iCab"...it then gave me a load of "A^@A^@A^@A^@A^@A^@A^@A^@..." OS X is BSD, so this should mean that i can be able to use the terminal to launch stuff; right? and also, how can i... (2 Replies)
Discussion started by: ah54wxcr4
2 Replies
Login or Register to Ask a Question