#!/usr/bin/perl use strict; use warnings; use Net::SSH::Expect; my $command0 = "ls -l /tmp"; my $command1 = "ls -l /temperature"; RunCmd(); sub RunCmd{ system("$command0 > /dev/null"); print "System status info is $? \n"; system("$command1 > /dev/null 2> /dev/null"); print "System status info is $? \n"; }