As in your last thread, when I asked:
Quote:
What operating system are you using?
What shell are you using?
How you remove <space> characters from the start and end of a shell variable depends entirely on what shell (including the version number) of the shell you're using.
Whenever you start a thread asking questions about a shell script, PLEASE tell us what operating system (including release number) and shell (including version number) you're using so we can make suggestions that will work in your environment.
Explain where your variables are initialized (or show us the code that is used to initialize them). The code you showed us in post #1 in this thread (if you're using a standard shell) would initialize the variable
tablename to an empty string and put that variable definition in the environment when it invoked the
yyyy utility. Once the
yyyy utility completed running, the
tablename variable would not be defined in your current shell execution environment (unless some other code that you haven't shown us assigned it a value.
If the code you showed us in post #1 was intended to show its initial value instead of how it was set, note that you said that variable had leading AND trailing spaces; but there are no trailing spaces on that line.