bash.iterate through same file names with different extensions
Hello
I have a set of files with similar pattern, like this: file1.aaa file1.bbb then file2.aaa file2.bbb, etc.... I'd like to iterate through these files using a for loop so that $i holds *.aaa and $j holds *.bbb and Code:
for ...;do myprogram $i $j;done thnx |
Quote:
But now, we need to clarify the question......;) What happens in the loop?---specifically, do you access the files one at a time? Or perhaps--at each stage, you access all files with suffix "aaa" and then all with "bbb" |
Quote:
so on each iteration following files are used: file1.aaa file1.bbb next iteration: file2.aaa file2.bbb regards |
oh it struck me now. my logic is false
a good solution would be to iterate on all *.aaa files and inside the loop, I'd just change the extension on each $i parameter to be .bbb and so the problem could be solved I guess that's it many thanks |
something like this:
Code:
for i in *.aaa __________________________________ Happy with solution ... mark as SOLVED If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post. |
oh great idea. that should work perfectly
thnx |
All times are GMT -5. The time now is 12:49 AM. |