Bonjour,
J’exécute un script sed contenant 2 commandes w write
La 1ere commande w ne semble pas prise en compteCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #!/bin/sh echo "tata titi tutu" >test.txt echo -n "#!/system/bin/sed -n -r -f 1 { x s/^$/toto/ w test2.txt x } tx :x s/i/y/g t lbp w test2.txt d :lbp p " >test.sed sed -n -r -f test.sed test.txt >result.txt
En commentant la 2eme je constate qu'elle est écraséeCode:
1
2
3
4
5
6
7
8
9
10
11
12 sh>sh ./test.sh sh>cat test.txt tata titi tutu sh> sh>cat result.txt tyty sh> sh>cat test2.txt tata tutu
Code:
1
2
3t lbp #w test2.txt d
Pourquoi ?Code:
1
2
3
4
5
6
7
8
9
10 sh>sh ./test.sh sh>cat test.txt tata titi tutu sh>cat result.txt tyty sh>cat test2.txt toto
Merci d'avance pour vos réponses