On 12/22/10 3:25 PM, [email protected] wrote:

> Repeat-By:
>       I enter the following commands and get the following results. I am
>       intending that the whole string be sent to a remote system where any
>       wildcard characters would be evaluated. From below, it appears that
>       my wildcard characters are being evaluated locally in ALL cases. Am
>       I mis-understanding this concept or is there a problem in bash?
> 
>       There is a file on my local system named /tmp/wtf.lsR and quite a few
>       similarly paterned files on the remote system. When I remove the local
>       file, command execution proceeds as expected/desired.
> 
> go...@goffeg bash-4.1 ~/gettowork };-) ssh r...@qchu20 ls -al /tmp/\*.lsR
> ls: cannot access /tmp/wtf.lsR: No such file or directory
> go...@goffeg bash-4.1 ~/gettowork };-) ssh r...@qchu20 "ls -al /tmp/*.lsR"
> ls: cannot access /tmp/wtf.lsR: No such file or directory
> go...@goffeg bash-4.1 ~/gettowork };-) ssh r...@qchu20 'ls -al /tmp/*.lsR'
> ls: cannot access /tmp/wtf.lsR: No such file or directory

Replace `ssh' with `echo' or `printf "%s\n"' to see what bash is passing
to an invoked program.

I suspect that ssh is invoking a shell, which is performing the expansion.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/

Reply via email to