# create a "special" symlink to your "cut" command: ln -s `which cut` ~/my_cut # now, assuming your home directory on host1 is different from your local one, # and you don't have a "my_cut" command in your home directory on host1: o=`ssh host1 tail -1 /etc/passwd | ~/my_cut -d: -f3-5` echo $o # now with perl: perl -e '$_=`ssh host1 tail -1 /etc/passwd | $ENV{HOME}/my_cut -d: -f3-5`; print'