assign a string variable onto itself with concat ksh



Hi,
In a ksh script I would like to assign a string back onto itself
while concatenating another string to it... something like this:

optString="$optString$newString"

I have a string variable: $optString that has the value "r"

I then get another string variable: $newString that has a value of "o"

I would like to end up with optString having a value of "ro"

As you might guess (or know outright! :-) my idea doesn't work. At
the end $optString still equals "r", not "ro". Can someone help me out
with something that works. (I have tried sed and awk as well, but
likely as not, I am not getting the syntax correct... just to let you
know I tried and am now pulling my hair out.)

TIA

BillR

.



Relevant Pages

  • Re: assign a string variable onto itself with concat ksh
    ... I want to check this string to see ... it then greps the optString for the presence of "o" which it does not ...
    (comp.unix.shell)
  • Re: assign a string variable onto itself with concat ksh
    ... In a ksh script I would like to assign a string back onto itself ... while concatenating another string to it... ... I would like to end up with optString having a value of "ro" ... unless you write a script and expect the variable to ...
    (comp.unix.shell)
  • Re: assign a string variable onto itself with concat ksh
    ... In a ksh script I would like to assign a string back onto itself ... while concatenating another string to it... ... I would like to end up with optString having a value of "ro" ... barmar $ optstring=r ...
    (comp.unix.shell)
  • Re: To quote or unquote strings in an echo?
    ... However, for a double-quoted string with no dollar signs, the running time ... Complexity of both parsers will be Oin this case, ... using commas within echo() is a language construct. ... which leads us to the matter of concatenating stuff. ...
    (comp.lang.php)
  • Re: Create Table SQL not working
    ... Tim & Jeff seemed to be so ... > concatenating the Number (converted to a string) to the end of a constant ...
    (microsoft.public.access.tablesdbdesign)