回答編集履歴
1
ちょうせい
test
CHANGED
@@ -7,3 +7,37 @@
|
|
7
7
|
aaaa12345
|
8
8
|
|
9
9
|
に置き換えればいいのでは?
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
# sample
|
14
|
+
|
15
|
+
```sh
|
16
|
+
|
17
|
+
#!/bin/sh
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
A0001="aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd";
|
22
|
+
|
23
|
+
B0001="12345";
|
24
|
+
|
25
|
+
echo $A0001|sed s/aaaaaaaaa/aaaa$B0001/g;
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
もしくは
|
30
|
+
|
31
|
+
```sh
|
32
|
+
|
33
|
+
#!/bin/sh
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
A0001="aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd";
|
38
|
+
|
39
|
+
B0001="12345";
|
40
|
+
|
41
|
+
echo $A0001|sed -E "s/(a{4})a{5}/\1$B0001/g";
|
42
|
+
|
43
|
+
```
|