08-14-2014
Thanks you a lot!!!! Works just fine!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, could anyone please tell me how to ssh to remote host foo and execute command on it and print the result on local host?
Thanks,
Paresh (1 Reply)
Discussion started by: masaniparesh
1 Replies
2. Shell Programming and Scripting
Hi all,
I am facing the following issue:
Host A should execute a remote command (say pwd) on host B2.
B2 is not directly reacheable but you have to connect from a to B1, then from B1 you can execute the command ssh user@B2 pwd.
B1 and B2 are directly connected:
A => B1 => B2
| ... (3 Replies)
Discussion started by: Evan
3 Replies
3. Shell Programming and Scripting
Hi all,
Today I want to write a script to run the commands remotely.
If I run the command as follows:
ssh <user>@<ip> 'ls; pwd'
it works fine.
But when I want to use ssh to set view in clearcase, it will lose the response. as follows
ssh <user>@<ip> 'cleartool setview <view_name>; pwd'... (1 Reply)
Discussion started by: Damon_Qu
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I'm unable to execute the below command completely ; it's not allowing me to type the complete command. It is allowing till "xargs" and i cannot even press enter after that.
I'm using Solaris. Let me know if anything needs to be added so as to execute the complete command. Appreciate... (12 Replies)
Discussion started by: venkatesht
12 Replies
5. UNIX for Dummies Questions & Answers
ssh -q <hostname> /opt/tcs/satish/tst.ksh
ssh -q <anotherserver> /opt/tcs/satish/tst.ksh
tst.ksh has "nohup <command> & "
when i execute below script , its throwing error as
nohup can not be found
ssh -q <anotherserver> /opt/tcs/satish/tst.ksh > log &
can someone let me... (5 Replies)
Discussion started by: only4satish
5 Replies
6. Shell Programming and Scripting
Hi I have a perl command that doesn't seem to be working correctly. It appears to be fine but even when i try and run it manually same thing. Can someone take a look at this and tell me what they think the problem could be?
Here is the perl Line:
system ("echo 'ssh -t -t $user\@$_ \"cd... (3 Replies)
Discussion started by: vpundit
3 Replies
7. Shell Programming and Scripting
How should i make the following code working
#!/bin/bash
INPUTFILE="test.txt"
while read STRING; do
IP=`host -t A $STRING | awk '{print $NF}'`
HOSTNAME=`ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no $IP "hostname"`
echo $HOSTNAME > out.txt
done < $INPUTFILE
At this moment while... (3 Replies)
Discussion started by: urello
3 Replies
8. Shell Programming and Scripting
In my .tcshrc I define and run an alias to set my terminal title. The title contains the hostname. I do this because I ssh to other machines a lot and I always need to know which host I am typing in. The alias is defined and run in the .tcshrc like this...
alias tt 'echo -n "^0;`hostname -s`^G"'... (5 Replies)
Discussion started by: salvadorjoshua
5 Replies
9. Shell Programming and Scripting
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
10. UNIX for Beginners Questions & Answers
How to execute setDomainEnv.sh in wblogic via ssh on remote server in shell script
we execute setDomainEnv.sh manually as . ./setDomainEnv.sh from its location ie /opt/SP/users/domian/bin"
My approach is not working.
Please advise.
#!/bin/bash
set -x
base="/opt/SP/users/d1/bin"... (5 Replies)
Discussion started by: abhaydas
5 Replies
LEARN ABOUT DEBIAN
coro::lwp
LWP(3pm) User Contributed Perl Documentation LWP(3pm)
NAME
Coro::LWP - make LWP non-blocking - as much as possible
SYNOPSIS
use Coro::LWP; # afterwards LWP should not block
ALTERNATIVES
Over the years, a number of less-invasive alternatives have popped up, which you might find more acceptable than this rather invasive and
fragile module. All of them only support HTTP (and sometimes HTTPS).
AnyEvent::HTTP
Works fine without Coro. Requires using a very different API than LWP. Probably the best choice iff you can do with a completely
different event-based API.
LWP::Protocol::AnyEvent::http
Makes LWP use AnyEvent::HTTP. Does not make LWP event-based, but allows Coro threads to schedule unimpeded through its AnyEvent
integration.
Let's you use the LWP API normally.
LWP::Protocol::Coro::http
Basically the same as above, distinction unclear. :)
AnyEvent::HTTP::LWP::UserAgent
A different user agent implementation, not completely transparent to users, requires Coro.
DESCRIPTION
This module is an AnyEvent user, you need to make sure that you use and run a supported event loop.
This module tries to make LWP non-blocking with respect to other coroutines as much as possible, and with whatever means it takes.
LWP really tries very hard to be blocking (and relies on a lot of undocumented functionality in IO::Socket), so this module had to be very
invasive and must be loaded very early to take the proper effect.
Note that the module AnyEvent::HTTP might offer an alternative to the full LWP that is designed to be non-blocking.
Here is what it currently does (future versions of LWP might require different tricks):
It loads Coro::Select, overwriting the perl "select" builtin globally.
This is necessary because LWP calls select quite often for timeouts and who-knows-what.
Impact: everybody else uses this (slower) version of select, too. It should be quite compatible to perls builtin select, though.
It overwrites Socket::inet_aton with Coro::Util::inet_aton.
This is necessary because LWP might (and does) try to resolve hostnames this way.
Impact: some code might not expect coroutine semantics, for example, when you fork you might prefer the blocking variant because other
coroutines shouldn't actually run.
It replaces the base class of Net::HTTP, Net::FTP, Net::NNTP.
This is necessary because LWP does not always use select to see whether a filehandle can be read/written without blocking, so the base
class "IO::Socket::INET" needs to be replaced by "Coro::Socket".
Impact: Coro::Socket is not at all compatible to IO::Socket::INET. While it duplicates some undocumented functionality required by LWP,
it does not have all the methods of IO::Socket::INET and might act quite differently in practise. Also, protocols other than the above
mentioned will still block, at least some of the time.
All this likely makes other libraries than just LWP not block, but thats just a side effect you cannot rely on.
Increases parallelism is not supported by all libraries, some might cache data globally.
AUTHOR
Marc Lehmann <schmorp@schmorp.de>
http://home.schmorp.de/
perl v5.14.2 2012-04-13 LWP(3pm)