On Wed, Jul 6, 2011 at 9:37 PM, SanskritFritz <[email protected]>wrote:
> On Wed, Jul 6, 2011 at 11:12 PM, Sebastian Thörn
> <[email protected]>wrote:
>
>> Hi guys and gals,
>>
>> i wonder if there is any chance to implement wildcards (*) into
>> the functionality of fish when using scp?
>>
>> this works in bash:
>> $ scp [email protected]:~/Whatever/*.pdf .
>>
>> This command will transfer all files in ~/Whatever/ ending with .pdf to
>> the working directory.
>> If i run the same command in fish i get the following:
>> ~> scp [email protected]:~/Whatever/*.pdf .
>> fish: Warning: No match for wildcard “[email protected]:~/Whatever/*.pdf”.
>> The command will not be executed.
>> scp [email protected]:~/Whatever/*.pdf .
>> ^
>>
>> I asked around in #fish and SanskritFritz and adisbladis explained to me
>> it's because bash is checking my files on the remote site or something. (i
>> didn't quit understand)
>>
>> My question is:
>> Would this be possible to implement in fish?
>>
>> Br
>> Sebastian Thör
>>
>
> Here is the transcript of that conversation.
>
> 10:21 < SanskritFritz> because that needs bash to look into the server over
> an ssh connection
>
Hi :)
Bash doesn't actually need to look at the server. What is going on is that
Bash can't match any local files against the wildcard, so it passes the
wildcard to scp. Scp then opens the connection, and uses the wildcard to
match against remote files.
Fish can do exactly the same thing. The difference is that fish substitutes
wildcards differently; If fish can't match wildcards to local files, then it
doesn't run and warns you about it. (Which is a really cool thing to do IMO,
it's great once you get used to it. Less dangerous, actually.)
What you want is to escape the wildcard, e.g. tell Fish to not process it
but rather pass it on to the process your're starting. This works here
because scp accepts wildcards.
I don't remember the syntax, but it's roughly like this:
scp user@server:dir/file\* localdir
or
scp user@server:"dir/file\*" localdir
or
scp "user@server:dir/file\*" localdir
Hope I'm not wrong here :)
-- Kristleifur
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users