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

Re: Bash variable escaping



On Tue, 10 Sep 2013 22:22:06 +0100
Chris Davies <chris@roaima.co.uk> wrote:

> Do you expect the program to see the asterisk character itself, or an
> expansion into the corresponding list of files in the current folder?

Hi,

I expect the program (salt) to see exactly '*' (single quote, asterisk,
single quote).

See examples of the salt-syntax here:
http://docs.saltstack.com/topics/targeting/globbing.html

At the moment i can't see any way how to do this.

machines="'*'"
salt $machines
salt ${machines}
salt "${machines}
salt "${machines}"
not working

machines='*'
salt $machines
salt ${machines}
salt "${machines}
salt "$machines"
not working

salt '*'
works fine

Also tried to execute it in a subshell and quoted the subshell call in
any way I could think of, but nothing… And every time I put an echo in
front of salt and it gave me exactly: salt '*' so from my point it
should work fine.

>> How can I avoid that?  
> This should work (notice the lack of quotes around the variable),  

No it doesn't, had tried it before and double checked it right now.

Anyway thanks for your reply.

Bye for now.


Reply to: