Skip to content


remote command execution with ssh

Executing a command that wants to write to the remote screen can fail if ssh invocation does not include the -t parameter.

# for h in `cat HoststoFix`
do 
    ssh -t $h 'cat /etc/security/ldap/ldap.cfg | \
    grep oldserver && \
    vi +%s/oldeserver/newserver/g +wq /etc/security/ldap/ldap.cfg'
done

Posted in Real life AIX.

Tagged with , , , .


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Ramon says

    Hi. Why you use vi to do that edits? sed was born because of that type of tasks

  2. MarkD:-) says

    Because some older versions of AIX do not allow SED to do that……



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2016 - 2017 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.