RE: [suse-programming-e] Simple question about shell scripting on SuSE 8.0
[...]
for each file found in the subdirectory tree of "folder" do "show the full path where the file was found, without the file name, like /root/folder/images" enter this directory already showed ($cd directory) "pipe the file to a program" done
[...] I'm not sure this is the right list for this, but your problem can probably be solved with "find". Read the find man page, but I will give you a quick summary of what may work. I am not sure why you want to "cd", so I'll exclude it in the example. find . -name script -exec {} | program ; You need to escape the opening curly brace and the semi-colon so as not to confuse the shell, but that should work (you may need to escape the pipe, however, as well. The curly braces are replaced by the file found (including the path -- so you don't have to cd to it) so this should work. Thanks, Patrick
participants (1)
-
Patrick Freeman