0

How do I pass variables as parameters to commands in a c shell?

Something like this:

    vncserver -depth $BITDEPTH -geometry $WIDTHx$HEIGHT

I appreciate your help!

Thank you!

MichaelScott
  • 387
  • 1
  • 3
  • 21

1 Answers1

0

The bit that might be causing confusion is the geometry: you're passing the concatenation of variable ${WIDTHx} and ${HEIGHT} (which was not what you had in mind).

Try:

vncserver -depth ${BITDEPTH} -geometry ${WIDTH}x${HEIGHT}

The only mandatory braces are those around ${WIDTH} (though the local coding standards here say 'all variable expansions shall use braces around the name', but they also say 'thou shalt not use C shell for scripting'); the others are for uniformity.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278