Remove double quotes bash
grep -e XkbLayout /etc/X11/xorg.conf | grep -v "^#" | awk '{print $3}'
output = "gb" sometimes= "us" anyone know how to make the ouputs gb us |
No need for grep if using awk:
Code:
awk '/XkbLayout/ && !/^#/ {gsub(/"/,"",$3); print $3}' /etc/X11/xorg.conf |
Thank you very helpful
|
How about a little less awk? set makes a handy substitue for awk when simply printing out a certain field:
Code:
set $(grep -e XkbLayout /etc/X11/xorg.conf | grep -v "^#") Code:
while read LINE ; do |
a few methods!
Code:
grep -e XkbLayout /etc/X11/xorg.conf | grep -v "^#" | tr -d \" Code:
$ x='"fish"' |
All times are GMT -5. The time now is 09:36 AM. |