how to use xrandr from script?

I am trying to use bash script to add resolution through xrandr and i keep getting error, here is my script:


out=`cvt 1500 800`
out=`echo $out | sed 's/(.*)MHz(.*)//g'`
input=`echo $out | sed 's/Modeline//g'`
#echo $input
xrandr --newmode $input
input2=`echo $out | cut -d" -f2`
#echo $input2
xrandr --addmode VNC-0 $input2

my problem is bash auto adds ‘ to output when it contains ” , and this messes out my input , how can i avoid this ?

Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.