[ale] scripts, file I/O, and loss of hair

Jim Kinney jim.kinney at gmail.com
Thu May 12 15:30:09 EDT 2011


Forget this mess!

Better mess!

I need to capture the PID of a process started over rsh (no hollering about
using ssh - cluster of compute nodes behind a master node). The process is
started on the master node with a heavily scripted rsh call.

Some stuff I've tried:
rsh $node 'echo $$; $command < $input &'
rsh $node 'echo $$; $command < $input &' &
rsh -n $node 'echo $$; $command < $input &'
mypid=$(rsh $node 'echo $$; $command < $input &')
rsh $node 'echo $$; $command < $input &' 2>&1

Yes. The echo $$ will actually get me the pid of the remote login shell but
that's enough

BTW: RHEL5 has a BUSTED rsh. -n DOES NOT WORK!

On Thu, May 12, 2011 at 2:10 PM, Jim Kinney <jim.kinney at gmail.com> wrote:

> I have a simple test script my_script
>
> #!/bin/bash
> # this is a crap script
> myout="$2"'.crap'
> directions=$(cat $2)
> echo "$myout"
> echo "$directions"
> exit
>
> It is launched by:
>
> ./my_script < test1.dat
>
> which is a file containing one line
> /tmp/
>
> which will be used later once the I/O issue is corrected.
> This is being done to replicate a much larger scenario
>
> When it is run, the output is:
> .crap
> /tmp/
>
> Notice that the file I want to be named test1.dat.carp is only named .crap
>
> I need to get the name of the input file into the script itself somehow.
> Positional parameters as not doing it.
>
> --
> --
> James P. Kinney III
>
> As long as the general population is passive, apathetic, diverted to
> consumerism or hatred of the vulnerable, then the powerful can do as they
> please, and those who survive will be left to contemplate the outcome.
> - *2011 Noam Chomsky*
>



-- 
-- 
James P. Kinney III

As long as the general population is passive, apathetic, diverted to
consumerism or hatred of the vulnerable, then the powerful can do as they
please, and those who survive will be left to contemplate the outcome.
- *2011 Noam Chomsky*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20110512/ceb77e21/attachment-0001.html 


More information about the Ale mailing list