Alex Daniloff wrote:
Hello SuSE folks, Could somebody tell me what application or script language is better to use to achieve the folowing tasks: 1. We have the directory with "xdir_name" name 2. In this directory we have files with "xdir_name_xfile_name". 3. In the first line each file has a header with "xdir_name" line. The question is how to automatically compare file header "xdir_name" to directory name "xdir_name" and if the file header doesn't match change it accordingly to the directory name where it is stored. Thanks in advance for any help. Alex
It would be quite easy to write in perl. I could help you if you like.
Assuming that these are text files (and quite small), something like this
might work. Well it is completely untested. Other people - feel free
to critisize.
#!/usr/bin/perl
cd "xdir_name"
while ($file =