UnluckyForSome Posted July 11, 2018 Share Posted July 11, 2018 (edited) 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! Edited July 11, 2018 by UnluckyForSome Quote Link to comment https://forums.phpfreaks.com/topic/307483-how-do-i-fix-my-globbing-syntax-when-using-grep-v-and-shell_exec/ Share on other sites More sharing options...
UnluckyForSome Posted July 11, 2018 Author Share Posted July 11, 2018 Seem to have fixed this with grep -v '([A-Z][a-z],' Quote Link to comment https://forums.phpfreaks.com/topic/307483-how-do-i-fix-my-globbing-syntax-when-using-grep-v-and-shell_exec/#findComment-1559570 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.