mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-31 19:08:07 +08:00
core: 兼容原版 ed
This commit is contained in:
parent
f8e58ab876
commit
2091854185
2
trans.sh
2
trans.sh
@ -462,7 +462,7 @@ insert_into_file() {
|
|||||||
apk add ed
|
apk add ed
|
||||||
in=$(mktemp)
|
in=$(mktemp)
|
||||||
cat /dev/stdin >$in
|
cat /dev/stdin >$in
|
||||||
echo -e "0r $in \n w \n q" | ed $file >/dev/null
|
echo -e "0r $in\n w \n q" | ed $file >/dev/null
|
||||||
else
|
else
|
||||||
line_num=$(grep -E -n "$regex_to_find" "$file" | cut -d: -f1)
|
line_num=$(grep -E -n "$regex_to_find" "$file" | cut -d: -f1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user