[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--transfer with absolute path does not respect --workdir
From: |
Jay Hacker |
Subject: |
--transfer with absolute path does not respect --workdir |
Date: |
Fri, 15 Jun 2012 08:29:55 -0400 |
[Moving this from bug tracker to mailing list at Ole's request]
Currently, if you use --sshlogin to run jobs on remote computers and
--transfer to send files, the files are placed in your home directory,
including any paths. So, as the man page says:
echo foo/bar.txt | parallel --sshlogin server.example.com --transfer wc
This will transfer the file foo/bar.txt to the computer
server.example.com to the file
$HOME/foo/bar.txt before running wc foo/bar.txt on server.example.com.
However, as an (undocumented) special case, absolute paths (starting
with /) are not put in your home dir, but at the same absolute path.
This seems
a.) surprising, because --transfer foo/bar.txt and $PWD/foo/bar.txt do
very different things, and
b.) less than useful, because I cannot transfer absolute paths to
another location. Anything in a read-only directory simply can't be
transferred.
Aha! you say; use --workdir! It lets you put transferred files
wherever you want!
But alas, --workdir has the (undocumented) special behavior of being
ignored for files with absolute paths. So, it is simply impossible to
transfer a file specified with an absolute path to your home dir.
To adhere to the principle of least surprise, I suggest --transfer
*always* puts things in --workdir, including any paths. If you want
to transfer things to an absolute path, just use --workdir=/ .
So for example:
$ parallel -S localhost --transfer ls ::: /etc/issue
Should give etc/issue in your $HOME, and
$ parallel -S localhost --workdir /tmp --transfer ls ::: /etc/issue
should give /tmp/etc/issue.
Thoughts?
- --transfer with absolute path does not respect --workdir,
Jay Hacker <=