Bug 2838 - Question about expanding wildcard on linux
Summary: Question about expanding wildcard on linux
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 7.6p1
Hardware: Other Linux
: P5 trivial
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-07 06:35 AEDT by bingbing8
Modified: 2018-03-09 09:44 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bingbing8 2018-03-07 06:35:14 AEDT
Since "Posting by non-members to openssh-unix-dev@mindrot.org is currently disabled." I post the question here. 
When run "scp .\tmp* sharefs:~" on Linux ubuntu 4.13.0-21-generic, the wildcard * is expanded, but look into source code scp.c, the expanding is not happening in scp.c. Where is the wildcard expanded?
Look into the sftp.c code, it calls glob to expands the wildcard.
Why scp can achieve the expanding without calling glob?
Thanks!
Comment 1 Darren Tucker 2018-03-07 08:46:34 AEDT
It's done by your shell.  Replace the scp with "echo" and you will see the same result.