Hallo everyone,
I am running this command line for my shell variable:
Let´s say, the output is one --> 1
I wanted to use this number for my case construction:
But it did not work. I was wondering why, and then I found a possible reason:
If I echo myVar, it gives me the correct answer:
But if I echo something with myVar inside, it gives me the REAL structure of myVar, which are some white spaces:
I assume, this is why I cant use myVar in my case structure. Somebody any idea how to solve this problem.
I have try:
It also didnt work.
Regards,
Ratna
I am running this command line for my shell variable:
Code:
myVar="$(db2 -x "select count(*) from mySchema.myTable")"
I wanted to use this number for my case construction:
Code:
case $myVar in
0 )
.... ;;
1 )
.... ;;
esac
If I echo myVar, it gives me the correct answer:
Code:
echo ${myVar}
1
But if I echo something with myVar inside, it gives me the REAL structure of myVar, which are some white spaces:
Code:
echo "word $myVar"
word 1
I have try:
Code:
... | tr -d ' '
Regards,
Ratna