944,030 Members | Top Members by Rank

Ad:
Jan 3rd, 2007
0

two variable sin single loop

Expand Post »
Hi,

I wan tto use 2 variables at same time in single loop. Like

for i in vs01a vs01b for k in 1 2
do
rsh $i echo 'tail -20 /opt/oracle/admin/+ASM/bdump/alert_+ASM$k.log' >> VS_logs.txt


how to do it. because for vso1a it's ASM1.log whereas for vs01b it's ASM2.log.

help me!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lastkey is offline Offline
3 posts
since Jan 2007
Jan 4th, 2007
0

Re: two variable sin single loop

Shell Scripting Syntax (Toggle Plain Text)
  1. for i in vs01a vs01b
  2. do
  3. for k in 1 2
  4. do
  5. rsh $i echo $(tail -20 /opt/oracle/admin/+ASM/bdump/alert_+ASM"$k".log) >> VS_logs.txt
  6. done
  7. done

For "rsh" do you mean rexec or remsh? Or does rsh create a remote shell on remote systems using your OS?
Reputation Points: 62
Solved Threads: 10
Junior Poster
jim mcnamara is offline Offline
179 posts
since May 2004
Jan 5th, 2007
0

Re: two variable sin single loop

rsh means remote shell. We use this method to access our remote systems. you applied two loops in the solution. But I've said ASM1.log file is on VS01a but not on VS01b, and ASM2.log is on VS01b not on VS01a. so it will give error when executed.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lastkey is offline Offline
3 posts
since Jan 2007
Jan 5th, 2007
0

Re: two variable sin single loop

Click to Expand / Collapse  Quote originally posted by lastkey ...
rsh means remote shell. We use this method to access our remote systems. you applied two loops in the solution. But I've said ASM1.log file is on VS01a but not on VS01b, and ASM2.log is on VS01b not on VS01a. so it will give error when executed.
Why loop? you only need two rsh lines. You gain nothing by looping.
Reputation Points: 62
Solved Threads: 10
Junior Poster
jim mcnamara is offline Offline
179 posts
since May 2004
Jan 5th, 2007
0

Re: two variable sin single loop

Why loop? you only need two rsh lines. You gain nothing by looping.
:cheesy: lol. Why!!!! That's what I did wrote straight two lines. But is there any harm to know the alternative way
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lastkey is offline Offline
3 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Full screen prob
Next Thread in Shell Scripting Forum Timeline: FInding dates on files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC