1 |
< |
#!/bin/bash |
1 |
> |
#!/usr/bin/env perl |
2 |
> |
use strict; |
3 |
|
#=================================================================================================== |
4 |
|
# Assume a list of local files is found to be broken. Go through the list and recover one by one. |
5 |
|
#=================================================================================================== |
6 |
< |
FILE="$1" |
7 |
< |
FLAG="$2" |
6 |
> |
my $file = "$ARGV[0]"; |
7 |
> |
my $flag = "$ARGV[1]"; |
8 |
> |
my $line = ""; |
9 |
|
|
10 |
< |
while read line |
11 |
< |
do |
10 |
> |
open(INFO, $file) or die("Could not open file ($file)."); |
11 |
> |
foreach $line (<INFO>) { |
12 |
> |
print "\nNew file: $line"; |
13 |
> |
system("fixFile.sh $line $flag") |
14 |
> |
} |
15 |
> |
close(INFO); |
16 |
|
|
17 |
< |
fullFile=`echo $line | cut -d ' ' -f1` |
18 |
< |
fixFile.sh $fullFile $FLAG |
19 |
< |
|
20 |
< |
done < $FILE |
17 |
> |
#FILE="$1" |
18 |
> |
#FLAG="$2" |
19 |
> |
# |
20 |
> |
#while read line |
21 |
> |
#do |
22 |
> |
# |
23 |
> |
# echo "LINE: $line" |
24 |
> |
# |
25 |
> |
# fullFile=`echo $line | cut -d ' ' -f1` |
26 |
> |
# echo fixFile.sh $fullFile $FLAG |
27 |
> |
# #fixFile.sh $fullFile $FLAG |
28 |
> |
# |
29 |
> |
#done |