Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So this works:

foo -a -b -c "path/file.ext"

And this too if I want to pass all files from directory:

foo -a -b -c path/*

But if I add the quotes

foo -a -b -c "path/*"

It doesn't work anymore: it says "no such file..."

And I think I need to add the quotes in order to escape arguments (I'm using PHP and escapeshellarg).

share|improve this question

closed as unclear what you're asking by Mikel, manatwork, Anthon, rahmu, terdon Oct 13 '13 at 16:50

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
What exactly expects that foo? –  manatwork Oct 13 '13 at 15:37
    
A list of file paths and it also supports wildcards –  mrry Oct 13 '13 at 15:38
    
it seems it does not support wildcards, as evidenced by the 'no such file' error –  glenn jackman Oct 13 '13 at 15:44
3  
Please explain exactly what foo is, the details will depend on it. –  terdon Oct 13 '13 at 15:44
1  
Why do you think you need escapeshellarg? This sounds like more of a PHP question than a UNIX/Linux question. –  Mikel Oct 13 '13 at 16:06

1 Answer 1

up vote 0 down vote accepted

The escapeshellarg docs say it turns it into: "a single safe argument"

But you want it to be interpreted as multiple arguments.

Try doing the expansion using glob first.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.