mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
23 lines
356 B
Bash
23 lines
356 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
detect_sed() {
|
||
|
if sed --version 2>/dev/null | grep -q "GNU"; then
|
||
|
SED_TYPE="GNU"
|
||
|
else
|
||
|
SED_TYPE="BSD"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
universal_sed() {
|
||
|
local expression=$1
|
||
|
local file=$2
|
||
|
|
||
|
if [[ "$SED_TYPE" == "GNU" ]]; then
|
||
|
sed -i "$expression" "$file"
|
||
|
else
|
||
|
sed -i '' "$expression" "$file"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
detect_sed
|