Re: printing variable values seperately.
From: tridentadm (tridentadm_at_softhome.net)
Date: 05/20/05
- Next message: Barry Margolin: "Re: tar command dangerously written"
- Previous message: Bruce Barnett: "Re: tar command dangerously written"
- In reply to: Ed Morton: "Re: printing variable values seperately."
- Next in thread: Chris F.A. Johnson: "Re: printing variable values seperately."
- Reply: Chris F.A. Johnson: "Re: printing variable values seperately."
- Reply: Ed Morton: "Re: printing variable values seperately."
- Reply: Bruce Barnett: "Re: printing variable values seperately."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 May 2005 20:54:38 -0700
sorry i didnt provide much clarity on my request.
i have a 'for loop' which is used for some other purpose.
so i dont want to use a for loop here.
eg.
cnt=0;
# consider $name would have "myproc yourproc ourproc"
for name in `ps -ef |grep pmon |grep -v grep |awk {'print $1'}`
do
echo $name
# consider var= "these three words"
# I want to print each word seperately .
echo $var[cnt+1];
done
OUTPUT :
myproc
these
yourproc
three
ourproc
words"
-- hope i am clear ps. if i give a 'for loop' for $var also, the output would vary, (isnt it??)
- Next message: Barry Margolin: "Re: tar command dangerously written"
- Previous message: Bruce Barnett: "Re: tar command dangerously written"
- In reply to: Ed Morton: "Re: printing variable values seperately."
- Next in thread: Chris F.A. Johnson: "Re: printing variable values seperately."
- Reply: Chris F.A. Johnson: "Re: printing variable values seperately."
- Reply: Ed Morton: "Re: printing variable values seperately."
- Reply: Bruce Barnett: "Re: printing variable values seperately."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|