I have script like
echo -n FINISHED FEXP: ${TABLE2EXP}
echo $STATUS
I want the output of both the echo statement in one line
How can i do this
I have script like
echo -n FINISHED FEXP: ${TABLE2EXP}
echo $STATUS
I want the output of both the echo statement in one line
How can i do this
Enclose the strings in double quote and at the end of first echo add a "\c"
echo "FINISHED FEXP: ${TABLE2EXP} \C"
echo "$STATUS"
when I am giving like this
STATUS= cat temp1 | grep "Highest return code encountered" | cut -d " " -f13,14,15,16,17,18
echo "FINISHED FEXP: ${TABLE2EXP}\c"
echo "$STATUS"
i am getting ooutptu as
Highest return code encountered = '0'.
FINISHED FEXP: ccc_conduit_gci
why its coming in different order , it should be like
FINISHED FEXP: ccc_conduit_gci
Highest return code encountered = '0'.
and even its not coming in one line
Because you are not assigning the STATUS correctly. To capture the value of a command into a variable, use backticks (grave accents, ASCII 96) or $(command)
The simplest and most portable solution to your original problem is to put all the information in a single echo.
STATUS=$(grep "Highest return code encountered" temp1 | cut -d " " -f13,14,15,16,17,18)
echo "FINISHED FEXP: ${TABLE2EXP} $STATUS"
I also took out the Useless Use of Cat -- grep knows full well how to read a file, you don't need cat for that.