. sed - . -i sed, (), , .
( , , .)
- , . , sed . .
, , .
, :
seq 0 999999 > x
, , , 4:
grep -v 4 1<>x <x
STDOUT (1) STDIN. grep , 4 ( -v).
.
, , :
…
999991
999992
999993
999995
999996
999997
999998
999999
537824
537825
537826
537827
537828
537829
…
Unix truncate, . , ( wc):
( x .)
(grep -v 4 <x | tee /dev/stderr 1<>x) |& wc -c
, , , 3653658. truncate:
truncate -s 3653658 x
.
script, i. . , :
length=$((grep -v 4 <x | tee /dev/stderr 1<>x) |& wc -c)
truncate -s "$length" x
, > 2 > 4 ; (32 ?) , . ( > 4 , ), :)
, :
- , .
- , ( , ..) undefined. ; , .
- , , , , , , ( ).