scp multiple files without pattern on Solaris

I need to transfer multiple files using scp between two solaris machines. I could not use pattern since they match with other files in the same directory.

I tried the below command, it does not copy any files.

$ scp -p user@machine1:/home/fid1/staging/\{a.ksh,b.ksh,c.ksh,d.ksh\} .

But this works.

$ scp -p user@machine1:/home/fid1/staging/a.ksh .

Could someone please explain?

Hi,
I think your solaris shell (sh) does not support syntax '{file1,file2,file3,...}'
Have you try with verbose option (-v) ?

Regards.

Can you copy another way around with list file

For instance :

cd <directory with files and list file> # or list file with absolute paths from anywhere.
scp $(cat list) user@remoteserver:/path/

Or create a regular expression which will match the files need from the first example [abcd].ksh
Also, you might want to use more modern shell such as ksh.

Hope that helps
Regards
Peasant.

I tried with (-v) option

19/01/2016 16:14:25:741 SftpAppLibSft/secsh_sft.c:3860/ssh_sft_get_conn_params: Connection id: #4, Destination: user@machine#22, Protocol version: secsh2, Cipher spec: aes128-cbc+hmac-sha1, Auth method: keyboard-interactive, Compression: none, Exclusive: yes
19/01/2016 16:14:26:696 SftpAppLibSft/secsh_sft.c:4179/ssh_sft_open_internal: Server SFT protocol version is 3.
19/01/2016 16:14:26:725 SftpAppLibSft/secsh_sft.c:3623/ssh_sft_server_type_probe: Server system type is POSIX.
19/01/2016 16:14:26:819 SftpAppLibSft/secsh_sft.c:3731/ssh_sft_server_streaming_probe_magic: Server supports EXTENDED streaming.
19/01/2016 16:14:27:081 SftpScpG3/scpg3.c:186/scp_exit: Exit code: 6

@Peasant: I could not do the other way since only functional ID(FID) has access to write to the folder, which I could not become from the remote server.

Another example -
On the local machine:

ssh -e none  user@remoteserver 'tar cf - a.ksh b.ksh c.ksh' | (  tar xf -)

Hi,
Can you try like this (without '\' ):

scp -p user@machine1:/home/fid1/staging/{a.ksh,b.ksh,c.ksh,d.ksh} .

Here, translation is doing by local machine...
Syntaxe not simplified:

scp -p user@machine1:/home/fid1/staging/a.ksh user@machine1:/home/fid1/staging/b.ksh user@machine1:/home/fid1/staging/c.ksh user@machine1:/home/fid1/staging/d.ksh .

Regards.

---------- Post updated at 02:52 PM ---------- Previous update was at 12:06 PM ----------

If you have /bin/bash on your remote machine, you have this trick:

scp -p user@machine1:\`/bin/bash\ -c\ "echo\ /home/fid1/staging/{a.ksh,b.ksh,c.ksh,d.ksh}"\` .

Regards.

Will this preserve time stamp?

---------- Post updated at 12:59 PM ---------- Previous update was at 12:39 PM ----------

First option did not work.
Second option works, as expected.
Third option did not work.

Ok,
Second option work if your local shell is not sh or ksh88 (and maybe ksh93 ???).
Syntax {a.ksh,b.ksh,...} is an option of many shell as bash.
For third option, have you /bin/bash on your remote machine ?
(I try this option on remote machine solaris with /bin/bash and it works fine).
Regards.