mirror of
https://github.com/bin456789/reinstall.git
synced 2025-12-10 15:37:43 +08:00
core: 兼容原版 ed
This commit is contained in:
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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user