![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Implementation not working correctly | AirBronto | High Level Programming | 14 | 02-15-2008 10:41 PM |
| if not working correctly | 2dumb | Shell Programming and Scripting | 3 | 05-03-2007 02:38 PM |
| assign value to variable is not working | agustincm | Shell Programming and Scripting | 3 | 10-13-2006 03:07 AM |
| Variable with $ do not show correctly | insania | Shell Programming and Scripting | 3 | 07-01-2006 11:24 PM |
| Script not working correctly | elchalateco | UNIX for Dummies Questions & Answers | 2 | 10-11-2002 04:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Variable not working correctly.
Hi,
I have a script where I am trying to set a local variable using the following, MYVAR="$NAME"_"$NAME2".txt where say, NAME = one NAME2 = two so I want the output one_two.txt but what I am getting is, two.txt basically the $NAME2 is overwriting, what am I doing wrong? Thanks, |
|
||||
|
Variable not working correctly
On my unix box everytime I use the underbar character "_" I run into trouble
when using it to concatenate two names. The OS reads in the underbar and looks to the next character, handling it differently. On one of your replies, someone demonstrated correctly that when you concatenate, keep the other names plus the underbar character all within double quotes. That way, the OS will treat the underbar as a literal character instead of (probably) a meta-character. |
| Sponsored Links | ||
|
|