Re: Scripting
- From: "caseyjbrotherton@xxxxxxxxx" <caseyjbrotherton@xxxxxxxxx>
- Date: Wed, 23 Apr 2008 09:51:22 -0700 (PDT)
One thing that you should be aware of when using either dsh, or
rsh is where your variables are getting interpreted, and where your
commands are actually being run.
For example, In your original example:
rsh $line cat /home/basks.tbl|awk '{ print $1 }' >>test.out
The cat is done on the remote node, the awk is done on the local node.
The entire /home/basks.tbl is being sent across the network.
What Mark had suggested is better, in a way...
rsh ${host} "awk '{print $1}' /home/basks.tbl"
The awk runs on the remote node, but the "$1" gets interpreted by
the local shell, and is replaced with a blank. This would mean that
the
whole file would be returned.
(To check the interpretations, use set -x and try the command
individually)
This would work better:
rsh ${host} "awk '{print \$1}' /home/basks.tbl"
Not understanding where the commands are being executed, and how the
variables
are interpreted will cause confusion about your data returned, but it
won't cause
the rsh to fail.
So, as Thomas has hinted, more information about what is actually
failing will probably
give you more help on how to fix it.
Hope this Helps
--Casey
.
- References:
- Scripting
- From: invincible
- Re: Scripting
- From: aix
- Re: Scripting
- From: Mark Taylor
- Re: Scripting
- From: Hajo Ehlers
- Re: Scripting
- From: Mark Taylor
- Re: Scripting
- From: Mark Taylor
- Re: Scripting
- From: invincible
- Re: Scripting
- From: Thomas Braunbeck
- Scripting
- Prev by Date: root cannot chown files
- Next by Date: Re: lsps shows high values but system appears to be fine
- Previous by thread: Re: Scripting
- Next by thread: bos.rte base set missing
- Index(es):