1833964 Members
1862 Online
110063 Solutions
New Discussion

Re: Declaring a Variable

 
SOLVED
Go to solution
Virumandi
Frequent Advisor

Declaring a Variable

Hi .,

I want to declare the output of a command to a variable ..

Here is the Explanation:

#cat filename | grep bdid |awk '"' -F'"' '{print $4}'
512

The output of the above command is 512 I want to declare this value to a variable..

Can anybody guide me..How to do it...
2 REPLIES 2
Yang Qin_1
Honored Contributor
Solution

Re: Declaring a Variable

#!/usr/bin

myVAR=`cat filename | grep bdid |awk '"' -F'"' '{print $4}'`

blabla
Virumandi
Frequent Advisor

Re: Declaring a Variable

Thanks it is working fine...