Mailinglist Archive: opensuse (686 mails)

< Previous Next >
Re: [opensuse] shell script help
Thanks to all who replied, both on and off list.

Here's the whole current script:

# run this in X terminal
echo "$ grep 'using VT' /var/log/Xorg.#.log"
grep 'using VT' /var/log/Xorg.`echo $DISPLAY|cut -d: -f2`.log
echo $ grep PRETTY /etc/os-release
grep PRETTY /etc/os-release
echo $ head -n7 /var/log/Xorg.#.log
head -n7 /var/log/Xorg.`echo $DISPLAY|cut -c2`.log
echo "$ grep Output /var/log/Xorg.#.log | egrep -v 'disconnected|no monitor'"
grep Output /var/log/Xorg.`echo $DISPLAY|cut -c2`.log | egrep -v 'disconnected|no monitor'
echo $ 'grep -v ^\# /etc/X11/xorg.conf.d/50-monitor.conf | grep DisplaySize'
grep -v ^\# /etc/X11/xorg.conf.d/50-monitor.conf | grep DisplaySize
echo $ 'grep -v ^\# /etc/X11/xorg.conf | grep DisplaySize'
grep -v ^\# /etc/X11/xorg.conf | grep DisplaySize
echo $ 'grep -v ^\# /etc/X11/xorg.conf.d/50-monitor.conf | grep PreferredMode'
grep -v ^\# /etc/X11/xorg.conf.d/50-monitor.conf | grep PreferredMode
echo $ 'grep -v ^\# /etc/X11/xorg.conf | grep PreferredMode'
grep -v ^\# /etc/X11/xorg.conf | grep PreferredMode
echo "$ xrdb -query | grep dpi"
xrdb -query | grep dpi
echo "$ xdpyinfo | egrep 'dime|ution'"
xdpyinfo | egrep 'dime|ution'
echo "$ xrandr | head -n5"
xrandr | head -n5

After seeing the replies and looking at the cut man page again, I tried and found cut -c2 to work, even though I didn't and don't understand the description of that usage. Based on the description, I expected -c0123 or -c0,1,2,3 to work. Maybe that's why those who suggested -d: -f2 suggested what they did. I also tried both -f1 and -f2 with and without -d:. I don't understand why -d: -f2 works. The -d: part I sort of get, but not why 2 and not 1 after -f.

I have several uses for this script. One is that I run it in Konsole and include it in a fullscreen screenshot to document how the desktop got configured to look the way it looks. The others are about getting info for Xorg and DE troubleshooting, bug definition/isolation and problem recreation. What I'd like to do to refine if further WRT getting the distro release name, current executable lines 3 & 4 of the script. Older Linux distros had no such file os-release. Those I've ever used do have various *-release files, but I wouldn't want to clutter the script's output with output from the several different ones from a single distro as is often the case.

A more doable improvement would likely be a tail on a longer Xorg log head when the head starts with several pre-release notice lines. For that I'd want to incorporate John H's suggestion to reuse the output from a single instance of echo $DISPLAY|cut....
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata ***
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >