in reply to creating a directory remotely implicitly

I guess you're using the OpenSSH package.

If so, it allows you to run remote commands using the ->system method. So, to create a remote directory before copying, you could run:

$ssh->system(qq{mkdir "$remote_dir"});

Replies are listed 'Best First'.
Re^2: creating a directory remotely implicitly
by t-rex (Scribe) on Jun 28, 2016 at 13:46 UTC

    i get the error cannot create directory still aftre using the qq command, is it that we can't create a directory within directory from one single command ? for example : /tmp/some-dir/some-dir2/xyz_uid_date/ now i have to create some-dir/some-dir2/xyz_uid_date/ in one command , how can that be done ?

      how can that be done ?

      According to the mkdir(1) manual page, using the option -p creates the parent directories of the target. Thus,

      $ssh->system(qq{mkdir -p "$remote_dir"});

      will do the trick.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'