bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wildcard characters being evaluated improperly?


From: Chet Ramey
Subject: Re: wildcard characters being evaluated improperly?
Date: Wed, 22 Dec 2010 21:53:32 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2

On 12/22/10 3:25 PM, goffe@google.com 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.
> 
> goffe@goffeg bash-4.1 ~/gettowork };-) ssh root@qchu20 ls -al /tmp/\*.lsR
> ls: cannot access /tmp/wtf.lsR: No such file or directory
> goffe@goffeg bash-4.1 ~/gettowork };-) ssh root@qchu20 "ls -al /tmp/*.lsR"
> ls: cannot access /tmp/wtf.lsR: No such file or directory
> goffe@goffeg bash-4.1 ~/gettowork };-) ssh root@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    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]