Skip to content

Commit 80796de

Browse files
author
git
committed
[Terry N.] cross platform
1 parent 260de19 commit 80796de

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

removeMath.sh

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#!/bin/bash -e
22

3-
UNAME=$( command -v uname)
3+
UNAME=$(command -v uname)
4+
file=$1
5+
6+
function nix {
7+
sed -i 's/.*$to_real.*//g' $file
8+
sed -i 's/.*$remainder_t.*//g' $file
9+
sed -i 's/.*$quotient_e.*//g' $file
10+
}
11+
12+
# Prepending the string expression with an empty string: '' lets it work on
13+
# macOS by mitigating unknown label errors
14+
function mac {
15+
sed -i '' 's/.*$to_real.*//g' $file
16+
sed -i '' 's/.*$remainder_t.*//g' $file
17+
sed -i '' 's/.*$quotient_e.*//g' $file
18+
}
419

520
case $( "${UNAME}" | tr '[:upper:]' '[:lower:]') in
621
linux*)
@@ -17,20 +32,6 @@ case $( "${UNAME}" | tr '[:upper:]' '[:lower:]') in
1732
nix
1833
;;
1934
*)
20-
printf 'unknown o/s\n'
35+
printf 'unsupported o/s\n'
2136
;;
2237
esac
23-
24-
nix() {
25-
sed -i 's/.*$to_real.*//g' $1
26-
sed -i 's/.*$remainder_t.*//g' $1
27-
sed -i 's/.*$quotient_e.*//g' $1
28-
}
29-
30-
mac() {
31-
# Prepending the string expression with an empty string: '' lets it work on
32-
# macOS by mitigating unknown label errors
33-
sed -i '' 's/.*$to_real.*//g' $1
34-
sed -i '' 's/.*$remainder_t.*//g' $1
35-
sed -i '' 's/.*$quotient_e.*//g' $1
36-
}

0 commit comments

Comments
 (0)