Skip to content

Commit

Permalink
Merge pull request #77 from olebole/install.sh
Browse files Browse the repository at this point in the history
Make "sed -i" portable between Linux and MacOS
  • Loading branch information
Ole Streicher authored Oct 31, 2018
2 parents f069f7a + b7a2a20 commit cbfb215
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ fi
for file in ${pfiles}; do
if [ -e "$file" ]; then
if [ "$exec" = "yes" ]; then
sed -e "s+$o_iraf+$iraf+" -i "$file"
sed -i.bak -e "s+$o_iraf+$iraf+" "$file"
RM "${file}.bak"
fi
fi
done
Expand All @@ -965,10 +966,12 @@ ECHO -n "Editing iraf/imdir/cache paths into system files ... "
err_seen=0
for i in ${PATHFILES}; do
if [ -e "$iraf/unix/hlib/$i" ]; then
sed -e "s|$o_iraf|$iraf|" \
sed -i.bak \
-e "s|$o_iraf|$iraf|" \
-e "s|$o_cache|$cache|" \
-e "s|$o_imdir|$imdir|" \
-i "$iraf/unix/hlib/$i"
"$iraf/unix/hlib/$i"
RM "${iraf}/unix/hlib/${i}.bak"
else
if [ "$err_seen" = 0 ]; then
DO_FAIL
Expand Down

0 comments on commit cbfb215

Please sign in to comment.