Tuesday, April 28, 2015

SSH : Pass Perl one-liner as argument to ssh

To pass perl one-liner as an argument to ssh command line, it can be done as follows

ssh server_ip_address << HERE zcat /usr/local/apache/logs/access_log.20150424.gz | perl -ne 'print if $_ =~ /" 404/'
HERE


No comments:

Post a Comment