Alternative to sed

This commit is contained in:
Elizabeth Cray 2024-08-05 21:24:18 -04:00
parent afbb0315c6
commit 8983526714
2 changed files with 8 additions and 3 deletions

View File

@ -3,6 +3,7 @@ virtualenv
python-dev python-dev
libffi-dev libffi-dev
build-essential build-essential
mariadb-server
libncurses-dev libncurses-dev
libusb-dev libusb-dev
avrdude avrdude

View File

@ -100,8 +100,12 @@ sed -i -e "s/pi/$USER/g" "moonraker.conf"
echo.Cyan "Setup Mainsail Config" echo.Cyan "Setup Mainsail Config"
cd $ROOT_DIR/$PRINTER_NAME/mainsail-config cd $ROOT_DIR/$PRINTER_NAME/mainsail-config
USABLE_HOME=`echo "$HOME" | sed -e 's/\//\\\//'` # USABLE_HOME=`echo "$HOME" | sed -e 's/\//\\\\\\\\\//g'`
sed -i -e "s/~\/printer_data/$USABLE_HOME\/$PRINTER_NAME\/printer_data/g" "client.cfg" # echo "s/~\/printer_data/$USABLE_HOME\/$PRINTER_NAME\/printer_data/g"
# sed -i -e "s/~\/printer_data/$USABLE_HOME\/$PRINTER_NAME\/printer_data/g" "client.cfg"
cat "client.cfg" | replace "~/printer_data" "$HOME/$PRINTER_NAME/printer_data" > tmp.client.cfg
rm client.cfg
mv tmp.client.cfg client.cfg
sed -i -e "s/pi/$USER/g" "client.cfg" sed -i -e "s/pi/$USER/g" "client.cfg"
# Download Mainsail # Download Mainsail