回答編集履歴
2
2
answer
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
# $2 is insert line position
|
6
6
|
# $3 is insert empty line count
|
7
7
|
|
8
|
-
head -$2 $1 >tmp.txt
|
8
|
+
head -n $2 $1 >tmp.txt
|
9
|
-
yes "" | head -$3 >>tmp.txt #ここはotnさんのを参考にしました
|
9
|
+
yes "" | head -n $3 >>tmp.txt #ここはotnさんのを参考にしました
|
10
10
|
x=`wc -l $1`
|
11
11
|
x=`expr $x - $2`
|
12
12
|
tail -n $x $1 >>tmp.txt
|
1
1
answer
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
yes "" | head -$3 >>tmp.txt #ここはotnさんのを参考にしました
|
10
10
|
x=`wc -l $1`
|
11
11
|
x=`expr $x - $2`
|
12
|
-
tail -$x $1 >>tmp.txt
|
12
|
+
tail -n $x $1 >>tmp.txt
|
13
13
|
cat tmp.txt
|
14
14
|
rm tmp.txt
|
15
15
|
```
|