If you can have your fortran program read from standard input and write to standard output, then it will be easily automated. Just redirect into and out of the program.
Your program may become actually simpler; no file-opening code at all
Code:
for FILE in *.txt
do
./myprogram < "$FILE" > "$FILE.out"
done
Sorry I know this is probably a very basic question but I have not been able to grasp this idea really of what you mean by standard input/standard output.
My current open statement reads as
OPEN(unit=10,file='nameofsinglefile.txt',status='old')
Would I adjust the above line to
file='$FILE.txt'
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 Frdz
while read line
do
name=`echo $line | cut -d' ' -f 1 `
password=`echo $line | cut -d`-` -f 2`
name > logfile.txt
password > logfile.txt
done < list.txt
When it is run, am getting last values in list.txt file only,it is not storing lall the list entry values. How can i... (5 Replies)
Hi,
I have thousands of files in a directory that have the following 2 formats:
289620178.aln
289620179.aln
289620180.aln
289620183.aln
289620184.aln
289620185.aln
289620186.aln
289620187.aln
289620188.aln
289620189.aln
289620190.aln
289620192.aln....
and:
alnCDS_1.fasta (1 Reply)
Hello
I am trying to run a python program using shell script, which takes a single argument from a file.
This file has one entry per line :
1aaa
2bbb
3ccc
4ddd
5eee
...
...
...
My shell script runs the program, only for the last entry :
#!/bin/sh
IFS=$'\n'
for line in $(cat... (2 Replies)
Hello all,
I am in need of assistance in creating a script that will remove a specified block of text from multiple .htaccess files. (roughly 1000 files)
I am attempting to help with a project to clean up a linux server that has a series of unwanted url rewrites in place, as well as some... (4 Replies)
I have a script where the the 9th line looks like this:
$filename=sprintf("250.1chr%d.ped", $N);
I want to modify this script 1000 times, changing 250.1chr%d.ped to 250.2chr%d.ped, 250.3chr%.ped.......and so on all the way to 250.1000chr%d.ped and store each output in files called
... (4 Replies)
I have multiple input files that I want to manipulate using a shell script. The files are called 250.1 through 250.1000 but I only want the script to manipulate 250.300 through 250.1000. Before I was using the following script to manipulate the text files:
for i in 250.*; do
|| awk... (4 Replies)
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)
Hi Everybody,
I'm a newbie to shell scripting, and I'd appreciate some help. I have a bunch of .txt files that have some unwanted content. I want to remove lines 1-3 and 1028-1098.
#!/bin/bash
for '*.txt' in <path to folder>
do
sed '1,3 d' "$f";
sed '1028,1098 d' "$f";
done
I... (2 Replies)
Discussion started by: BabyNuke
2 Replies
LEARN ABOUT V7
stdio
STDIO(3S)STDIO(3S)NAME
stdio - standard buffered input/output package
SYNOPSIS
#include <stdio.h>
FILE *stdin;
FILE *stdout;
FILE *stderr;
DESCRIPTION
The functions described in Sections 3S constitute an efficient user-level buffering scheme. The in-line macros getc and putc(3) handle
characters quickly. The higher level routines gets, fgets, scanf, fscanf, fread, puts, fputs, printf, fprintf, fwrite all use getc and
putc; they can be freely intermixed.
A file with associated buffering is called a stream, and is declared to be a pointer to a defined type FILE. Fopen(3) creates certain
descriptive data for a stream and returns a pointer to designate the stream in all further transactions. There are three normally open
streams with constant pointers declared in the include file and associated with the standard open files:
stdin standard input file
stdout standard output file
stderr standard error file
A constant `pointer' NULL(0) designates no stream at all.
An integer constant EOF (-1) is returned upon end of file or error by integer functions that deal with streams.
Any routine that uses the standard input/output package must include the header file <stdio.h> of pertinent macro definitions. The func-
tions and constants mentioned in sections labeled 3S are declared in the include file and need no further declaration. The constants, and
the following `functions' are implemented as macros; redeclaration of these names is perilous: getc, getchar, putc, putchar, feof, ferror,
fileno.
SEE ALSO open(2), close(2), read(2), write(2)DIAGNOSTICS
The value EOF is returned uniformly to indicate that a FILE pointer has not been initialized with fopen, input (output) has been attempted
on an output (input) stream, or a FILE pointer designates corrupt or otherwise unintelligible FILE data.
STDIO(3S)