I'm facing a problem and trying to find a solution that works in sh. If I could use bash this code would work:
ls /a|grep ^[0-9]
Unfortunately this is not the case with sh, and yes I need to use sh. :) Running in sh i get
ls /a |grep ^[0-9] [0-9]: not found Usage: grep -hblcnsviw pattern file . . .
If I remove the ^ the code works but I need only the files that start with numbers and not the ones that contains numbers. Example, I need the files that are like:
from the grep man page I should be able to use
For the time being my implementation was done by using:
ls /a|grep -v [a-z]|grep -v [A-Z]
As this will remove all the files that contains chars, but still if a file is .123.33 it will show up.