Re: assign a string variable onto itself with concat ksh
- From: Bill Marcum <bmarcum@xxxxxxxxx>
- Date: Wed, 27 Sep 2006 22:11:18 -0400
On 27 Sep 2006 18:57:19 -0700, theshowmecanuck
<theshowmecanuck@xxxxxxxxx> wrote:
Hi,That should work, unless you write a script and expect the variable to
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.)
be changed after the script has ended. In that case, you need to use
the "." command.
--
We have a equal opportunity Calculus class -- it's fully integrated.
.
- References:
- assign a string variable onto itself with concat ksh
- From: theshowmecanuck
- assign a string variable onto itself with concat ksh
- Prev by Date: assign a string variable onto itself with concat ksh
- Next by Date: Re: duplicate entries - compare files
- Previous by thread: assign a string variable onto itself with concat ksh
- Next by thread: Re: assign a string variable onto itself with concat ksh
- Index(es):
Relevant Pages
|