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 example, 1.dat, 2.dat,..., so on.
2. Call a C program within the for-loop in that shell program. The C program reads the file name in argv [ 1 ], which is defined within the program.
3. Loop until all files have been read by the C program.
This is what I have done.
My original shell script was this:
But the above script is very slow when the number of files is really really big. SO I am now trying to do this:
But when I run the shell script, I get the following errors:
Hi,
I am trying to write a shell script that will go to another folder and run the script in that folder. The folder structure is kind of like this:
/MainFolder/
|-> MainShellScript.sh
|
|-> Folder1/
|-----|-> script1.sh
|-----|-> FileToRun1.jar
|
|-> Folder2/
|-----|-> script2.sh... (3 Replies)
Folks i have written two scripts that do reading of csv files , i am currently fetching the all part of the line in to variables and braking the line into several variables.
I am doing the same thing in an another shell script, i want to integrate both the scripts in to a single one where i can... (2 Replies)
Hello,
So I have approximately 300 files of raw data (.txt) files that I am using to perform statistical analysis. I have been able to construct a Fortran program that is able to perform my statistical analysis on a file by file basis.
However, I now want to be able to loop program through... (19 Replies)
Hi,
Can any one tell me if i can read two files in a shell script...
My actual requirement is to read the 1st text file and parse it to get the file code and use this file code to retrieve data from database and print the fetched data in the 2nd text file (I have parsed it and printed the... (2 Replies)
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)
Hi,
Below is my issue which I desperately need and I want a shell script which can do this job.
I need this script as I m planning to put this for a system health check. Please assist me.
1. There are 10 log files in a particular location.
2. open each log file. Goto to the end of the... (4 Replies)
hi Friends,
Please help me in writing shell script to run list of sql files.
database is Oracle 9i,
unix os is solaris
Requirement is
1. sql file must take two inputs a)feed id and b)business date
2.shell script must out put .xls or .csvfile as out put without trimming any column name and... (1 Reply)
Hi all,
I have to generate some report from shell script .We have stacktrace log file which generate hourly basis.
So now my q is that how this shell script will read all stacktrace log file for particlular day and parse accordingly desire output.
Any help or suggestion as i am newbie with... (1 Reply)
suppose have different files
1.1
2.2
3.3
4.4
5.5
All the files have to run under the same command say
tr -d '\n'
so how to run all the files under the same command by using shell script (3 Replies)
Hi,
I need to generate a test data file by reading inputs from multiple files.
A sample pseudo code for this program to read from three files and write to a output file would be like:
open(OUTPUTFILE, "data");
open(INFILE1, "data1");
open(INFILE2, "data2");
open(INFILE3, "data3");
... (1 Reply)