[Ilugc] storing result in variables

  • From: raamanp@xxxxxxxxxxx (Raman.P)
  • Date: Mon, 23 Feb 2004 05:00:39 +0000 (GMT)

 --- babu jayapaul <babu_jayapaul@xxxxxxxxx> wrote: > how to store
the resulting values of expression in a

variable.

for example

  x=ipx_configure | cut -d " " -f 5
  y= tail -l | cut -d : -f 3

the variable x/y is empty empty ?

kindly give me a solution to do this.

if you want output of a command in a variable you can use backtick

x=`tail -n 2 xyzfile|cut -f 3 -d :`
echo $x

Raman.P


________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services, 
tools and more. 
Go to: http://in.insurance.yahoo.com/licspecial/index.html

Other related posts: