EvilZone
Programming and Scripting => Scripting Languages => : icon March 31, 2014, 04:17:30 AM
-
So, I kinda feel like an idiot because I can't figure this out. I would like to be able to use a command line argument in line with text. Not sure if the phrasing is right for what I want, but hopefully this example will help:
var1 = $1
var2 = $2
someCommand "$var1x$var2" blah blah blah
So, my problem is that the "x" is being grouped in with the variables. Any thoughts would be appreciated.
-
So, I kinda feel like an idiot because I can't figure this out. I would like to be able to use a command line argument in line with text. Not sure if the phrasing is right for what I want, but hopefully this example will help:
var1 = $1
var2 = $2
someCommand "$var1x$var2" blah blah blah
So, my problem is that the "x" is being grouped in with the variables. Any thoughts would be appreciated.
Yes you are phrasing this wrong :P
-
Yep.. I don't get it either :) Could you maybe post your script and explain what you trying to do and what does not work for you?
-
You probably mean to do:
someCommand "${var1}x${var2}" blah blah blah
?
-
Thanks for the quick responses.
Something like this:
#!/bin/bash
hRes = $1
vRes = $2
xrandr --newmode "$hResx$vRes.00" 173.00 $vRes 2048 2248 2576 $hRes 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 $vResx$hRes_60.00
xrandr --output Virtual1 --mode $vResx$hRes_60.00
Yes you are phrasing this wrong :P
I think we've all had the problem of know what we mean, but not knowing how to express it.