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
libffi-dev
build-essential
mariadb-server
libncurses-dev
libusb-dev
avrdude
@ -14,4 +15,4 @@ dfu-util
libnewlib-arm-none-eabi
gcc-arm-none-eabi
binutils-arm-none-eabi
libusb-1.0
libusb-1.0

View File

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