in reply to Re^3: Heredoc with system call
in thread Heredoc with system call
The only problem is to run "cp $source $dest" on the next line soon after the "ls" command. But I am not sure how to pass these arguments ?print "I want to copy $source to $dest after logging-in as ABU"; open my $fh, "|-", "sudo su - ABU" or die "can't run sudo: $?"; print $fh <<_EOF_; echo 'Logged-in as ABU' ls _EOF_ close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Heredoc with system call
by bliako (Abbot) on Apr 22, 2019 at 18:03 UTC |