[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] bash beginner
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] bash beginner |
Date: |
Fri, 11 May 2012 13:54:52 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, May 11, 2012 at 11:47:51AM -0500, Muriel Diaz wrote:
> I want to execute a line comand (autodock4 -p flename.dpf -l filename.dlg)
> in many folders in a directory. is It posibble?. the line
> comand corresponds to a program called autodock. The name of file .dpf
> (input file) varies in each folder of the directory. The file .dlg is the
> output file. How can I do it?
Some assumptions have to be made here, because it's not all clear.
Is there precisely *one* .dpf file per directory? With unknown name?
And do you want the output file to have the same name, except for the
.dlg suffix? And it's just a single level of subdirectories, not
fully recursive?
for dir in */; do
( cd "$dir" || exit; file=(*.dpf); output=${file%.dpf}.dlg;
autodock4 -p "$file" -l "$output" )
done