Jump to content

How do I fix my globbing syntax when using grep -v and shell_exec


UnluckyForSome

Recommended Posts

Hi!

I want to list files that match a certain pattern:

Name (Europe)

but also DOES NOT contain the pattern:

(??,

AKA an open bracket, two characters which could be anything and a comma - For example (En,

I am having to use shell_exec as the script is going through all sorts of files with funny characters. So far I have:

$fCheck = trim(shell_exec("ls -1 \"{$niceName} (Europe)\"* 2>/dev/null | grep -v '(??,'"));

But I think the globbing syntax is wrong? That or the shell_exec is messing it up somehow. Apologies for my lack of knowledge!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.