Assigning variable is messing up
I am trying to run this and was into issues
function() {
node=echo "10.11.12.13" | awk '{split ($0, a, "."); print a[1]}'
}
function1() {
function
a=$node
echo $a
echo $a "- 2nd time"
}
This output's first a as 10, that's ok but second a as "0", so i was unable to use it anywhere inscript for second time.
I found the actual issue, but I wanna know why is it so
node=`echo "10.11.12.13" | awk '{split ($0, a, "."); print a[1]}'`
The above line works, but why?
Can someone please help me
Thank you
Last edited by voldemort; 11-05-2010 at 02:11 PM.
Reason: missed some lines
|