-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtempscrap
75 lines (50 loc) · 3.06 KB
/
tempscrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "*"
echo "modifiez synth2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep modifiez
echo "creez synth2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "creez"
echo "ajoutez synth2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "ajoutez"
echo "ajouter synth2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "ajouter"
# synthèse 2 original files with cat -n genfile
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "*" > $directory_output/grep_star_synth2.txt
echo "modifiez synth2 : genfile2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep modifiez > $directory_output/grep_modifiez_synth2.txt
echo "creez synth2 : genfile2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "creez" > $directory_output/grep_creez_synth2.txt
echo "ajoutez synth2 : genfile2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "ajoutez" > $directory_output/grep_ajoutez_synth2.txt
echo "ajouter synth2 : genfile2 : "
cat -n res.txt | head -n $(( $grep_synth2_line )) | tail -n $(( $diff_start_line_to_synth2 )) | grep "ajouter" > $directory_output/grep_ajouter_synth2.txt
# synthèse 2 for debug genfile
echo "synth2 debug genfile"
cat $directory_output/grep_*_synth2.txt | cut -f 5- -d ' '
# sorting synth 2:
echo "sorting synth2 "
cat $directory_output/grep_*_synth2.txt | sort
# sorting synth 2 for sed :
echo "sorting synth2 for sed "
cat $directory_output/grep_*_synth2.txt | sort | cut -f 5- -d ' '
# sorting synth 2 for sed gen file :
echo "sorting synth2 for sed gensedfile "
cat $directory_output/grep_*_synth2.txt | sort | cut -f 5- -d ' ' > $directory_output/sed_genfil_synth2_backup.txt
cat $directory_output/grep_*_synth2.txt | sort | cut -f 5- -d ' ' > $directory_output/sed_genfil_synth2.txt
# synthèse 2 files for sed of gensedfile
echo "replacing by sed synth2 for gensedfile "
sed 's/modifiez/on a modifié/g' -i $directory_output/sed_genfil_synth2.txt
sed 's/creez/, on a créé/g' -i $directory_output/sed_genfil_synth2.txt
sed 's/ajoutez/, on a ajouté/g' -i $directory_output/sed_genfil_synth2.txt
sed 's/ajouter/, on a ajouté/g' -i $directory_output/sed_genfil_synth2.txt
sed 's/*/ /g' -i $directory_output/sed_genfil_synth2.txt
echo "uniq for duplicate : " $uniq_for_duplicate_synth2
if [ $(($uniq_for_duplicate_synth2)) -ge 2 ]
then
echo "uniq state true"
cat $directory_output/$file_output_synth2 | uniq > $directory_output/$file_output_synth2
else
echo "uniq state false"
fi
# synthèse 2 files cat for sed of gensedfile
echo "cat replaced by sed synth2 for gensedfile "
cat $directory_output/sed_genfil_synth2.txt