hi
how can read screen dimensions as two variables(wxh)??
because the below command read it as a line wxh
xdpyinfo | grep 'dimensions:'
also where can I find complete reference for bash script with examples??
Code: Select all
#!/bin/bash
SIZES=$(awk '/fbwidth/{ print $2 " " $3}' /proc/cmdline)man bash is comprehensive.hamza wrote:where can I find complete reference for bash script with examples??
The problem is that, like "man gcc" or reading the C standards documents, reading it won't really tell you how to program in it. That comes only with experience.B.Goode wrote: man bash is comprehensive.
Code: Select all
pi@raspberrypi ~ $ set -- \
$(xdpyinfo | gawk '/dimensions/ {sub(/x/," ",$2);print $2}')
pi@raspberrypi ~ $ echo $1 $2
1280 778
pi@raspberrypi ~ $