Article 5J192 Awk in Yad file replace existing value

Awk in Yad file replace existing value

by
valtam
from LinuxQuestions.org on (#5J192)
My current bash script is:

Code:#!/bin/bash

# Variables
fileloc="/home/jerry/scripts/widget"

# Backup file first
cp $fileloc $fileloc.backup

widedit=`(yad --title="Linux Lite - Widget Editor" --borders=20 --text="All fileds <span font='Roboto Bold 12'>MUST</span> have a value:\n" --form \
--field="Gap X (0 - total monitor width span in pixels): ":NUM '!0..100000!1' \
--field="Gap Y (0 - total monitor height span in pixels): ":NUM '!0..100000!1' \
--field="Transparent (yes or no ):":CB yes!no! \
--button=gtk-apply:0)`

# Write to configuration file

echo $widedit | awk '{ sub(/gap_x/,"gap_x "$1); print }' >> $fileloc
echo $widedit | awk '{ sub(/gap_x/,"gap_x "$2); print }' >> $fileloc
echo $widedit | awk '{ sub(/gap_x/,"gap_x "$3); print }' >> $fileloc

exit 0I'm wanting to have the line in /home/jerry/scripts/widget that shows gap_x 65 to read the value I input into the yad box, then overwrite the existing value in the widget file. At this point I am stuck. Thank you in advance.latest?d=yIl2AUoC8zA latest?i=j5cS3m5fpHU:X8-fT6zOl88:F7zBnMy latest?i=j5cS3m5fpHU:X8-fT6zOl88:V_sGLiP latest?d=qj6IDK7rITs latest?i=j5cS3m5fpHU:X8-fT6zOl88:gIN9vFwj5cS3m5fpHU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments