l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social Gathering
Next Installfest:
Sat. Sept. 27, 10am-6pm
Latest News:
Aug. 30: September Installfest scheduled
Page last updated:
2003 Nov 03 09:06
Events
 Meetings
 Installfests
 Demos
 Photos
Services
 Library
 LERT
 Jobs
 Documents
Interact
 Mailing Lists
 - Search
 - Archives
 Chat
About Us
 Members
 Projects
 Testimonials
 Call for Speakers
 Why Not MS?
 Finances
 Sponsors

^Home
?Search
?News & RSS
?Calendar
@Contact Us
$Buy Stuff
=Printable


The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] shell question: globbing and command arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] shell question: globbing and command arguments



To be more general, you should escape the *, and then it gets passed
to the remote scp, which is smart enough to handle it (it actually uses
the shell on the remote machine to do the globbing.)

If you're using older shells (real bourne shell, csh, etc.) then the
unescaped * will cause an error (unless you 'set noglob' in csh).
Bash is smart enough to realize that if no local globbing works, that
it should just be passed on to the underlying program, for instance:

[mrp@calisto mrp]$ echo frobble*
frobble*
[mrp@calisto mrp]$ echo f*
fern.jpg ffjuser30 flash forAudrey forte4j fun
[mrp@calisto mrp]$ csh
[mrp@calisto ~]$ echo frobble*
echo: No match.
[mrp@calisto ~]$ set noglob
[mrp@calisto ~]$ echo frobble*
frobble*
[mrp@calisto ~]$

Thus endeth the unix history lesson :-)

  -- Mitch

On Monday, Nov 3, 2003, at 08:37 US/Pacific, p@dirac.org wrote:

i've always wondered about this...

if i have a bunch of files on a remote host beginning with "backup", i
can copy them to the local host using:

   scp p@remote.host:backup* .

and it works.  but why?  doesn't the shell get to "*" first?  i'd
understand this working:

   scp 'p@remote.host:backup*' .

but why does scp see the asterisk in the unquoted version?

pete

--
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

CD Burns Wanted!

LUGOD: Linux Users' Group of Davis
1105 Kennedy Place, Suite 1, Davis, CA 95616
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Z-World
Who has helped LUGOD immensely!