Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 04-09-2004, 12:28 PM   #1
jęd
Prospect
 
Join Date: Apr 2004
Posts: 24
Scp'in to self

Hi.

I'm having the following problem in Panther...

If i do:

scp jęd@remote_machine:/home/jęd/foo.ff .

I am fine...

If I do:

scp jęd@remote_machine:/home/jęd/*.ff .

I have the message:

tcsh: scp: No match.

I can log into my ibook of from a linux box (the reqests are from a remote linux box)... Any suggestions...?
jęd is offline   Reply With Quote
Old 04-09-2004, 12:34 PM   #2
huskerchad
Major Leaguer
 
Join Date: Feb 2004
Posts: 278
Try protecting the asterisk with quotes, otherwise it will do file matching on the machine you are running scp from.

Code:
scp 'jęd@remote_machine:/home/jęd/*.ff' .
I'm not sure if scp supports wildcards or not, but if it does, this is the way you would need to do it.
huskerchad is offline   Reply With Quote
Old 04-09-2004, 12:35 PM   #3
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,652
Try putting some quotes around the user@remotehost:*.foo.

D'oh! Huskerchad beat me to it! But he's right. This will work with wildcards.
__________________
Chameleon's Consignment Loft]
yellow is offline   Reply With Quote
Old 04-09-2004, 02:22 PM   #4
vancenase
All Star
 
Join Date: Apr 2003
Location: OH
Posts: 934
hot dog that's awesome; i've been doing it file-by-file or dumping the files into a folder and using rsync.
vancenase is offline   Reply With Quote
Old 04-10-2004, 06:46 AM   #5
jęd
Prospect
 
Join Date: Apr 2004
Posts: 24
Quote:
Originally Posted by yellow
Try putting some quotes around the user@remotehost:*.foo.

D'oh! Huskerchad beat me to it! But he's right. This will work with wildcards.

That works perfectly... Why does it need the quotes? I've never had to do that on 'nix boxes...
jęd is offline   Reply With Quote
Old 04-10-2004, 01:06 PM   #6
huskerchad
Major Leaguer
 
Join Date: Feb 2004
Posts: 278
You need them because you want the wildcard to expand on the remote machine. When you type something like

Code:
commandname pattern*
You are not calling "commandname" with the argument "pattern*". The shell looks in the current directory and replaces the argument you typed with a list of every file that matches.

So when you do "scp jęd@remote_machine:/home/jęd/*.ff ." the shell does pattern maching (before scp is executed); I'm assuming the colon after the remote machine name causes the matching to be performed for files matching "/home/jęd/*.ff", but you probably don't have such a directory on your OS X machine, thus no files match, and you get the error: note that your error was coming from the shell "tcsh".

This is the same in virtually any shell, it is nothing specific to OS X. It is possible this command might work for you as you intended from one unix machine to another, if both machines have your home directory at "/home/jęd" and on both machines, you have these ".ff" files in your home directory.
huskerchad is offline   Reply With Quote
Old 04-10-2004, 03:21 PM   #7
huskerchad
Major Leaguer
 
Join Date: Feb 2004
Posts: 278
Actually, now that I think about it there may be one other thing going on. If no files match a wildcard patter, bash will leave the string as-is, while tcsh gives an error. To see this, compare the results of

Code:
bash -c "/bin/echo nofile*"
and

Code:
tcsh -c "/bin/echo nofile*"
that is assuming there is no file matching the pattern "nofile*" in the current directory.

So when the scp command above is issued from the bash shell, and no local files match the pattern, it is passed on to the scp command as-is (including the wildcard character). When it is issued from tcsh and no files match, an error occurs.
huskerchad is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Site design © Mac Publishing LLC; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of Mac Publishing LLC.